Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to modify Contact Us meta tags?

 
Closed Thread
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-14-2016, 01:01 PM
 
www.cheapglasses.net www.cheapglasses.net is offline
 

Advanced Member
  
Join Date: Dec 2015
Posts: 77
 

Default How to modify Contact Us meta tags?

At www.cheapglasses.net, I found the following pages have the same description:
Contact us
My Account
Register

<meta name="description" content="The powerful shopping cart software for web stores and e-commerce enabled stores is based on PHP5 with SQL database with highly configurable implementation based on templates" />

How can we modify each page's meta tags (title, description,keywords),pls?
  #2  
Old 02-14-2016, 10:48 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How to modify Contact Us meta tags?

Out of the box you can change the meta description and keywords for content pages only (products, categories, brands, articles, ...). I.e. for those pages that contain information that people may search for in search engines. I believe that for other types of pages the meta tags are almost useless and give you nothing from the SEO perspective.

However, you can alter the tags by creating a module that overrides the \XLite\Controller\AController::getMetaDescription( ) and \XLite\Controller\AController::getKeywords() methods.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
  #3  
Old 02-15-2016, 02:56 AM
 
www.cheapglasses.net www.cheapglasses.net is offline
 

Advanced Member
  
Join Date: Dec 2015
Posts: 77
 

Default Re: How to modify Contact Us meta tags?

Quote:
Originally Posted by qualiteam
Out of the box you can change the meta description and keywords for content pages only (products, categories, brands, articles, ...). I.e. for those pages that contain information that people may search for in search engines. I believe that for other types of pages the meta tags are almost useless and give you nothing from the SEO perspective.

However, you can alter the tags by creating a module that overrides the \XLite\Controller\AController::getMetaDescription( ) and \XLite\Controller\AController::getKeywords() methods.


how to do, pls?
  #4  
Old 02-16-2016, 02:12 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How to modify Contact Us meta tags?

For the contact us page you should create classes/XLite/Module/XC/CustomSkin/Controller/Customer/ContactUs.php with the following contents and then enable Custom Skin module (or redeploy the store if the module is enabled already):
PHP Code:
<?php

namespace XLite\Module\XC\CustomSkin\Controller\Customer;

/**
 * Decorated controller class.
 * 
 * @LC_Dependencies ("CDev\ContactUs")
 */
class ContactUs extends \XLite\Module\CDev\ContactUs\Controller\Customer\ContactUs implements \XLite\Base\IDecorator
{
    
/**
     * Get meta description
     *
     * @return string
     */
    
public function getMetaDescription()
    {
        return 
'Your custom meta description for pages handled by this controller class';
    }

    
/**
     * Get meta keywords
     *
     * @return string
     */
    
public function getKeywords()
    {
        return 
'Your custom meta keywords for pages handled by this controller class';
    }
}

For other pages you should create similar files, but with a different location/namespace/name of the class being extended. Also, you need the @LC_Dependencies only for controller classes that are added by modules (change it in accordance with the module name), for core classes skip it.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions

The following user thanks qualiteam for this useful post:
www.cheapglasses.net (02-16-2016)
  #5  
Old 02-16-2016, 02:28 AM
 
www.cheapglasses.net www.cheapglasses.net is offline
 

Advanced Member
  
Join Date: Dec 2015
Posts: 77
 

Default Re: How to modify Contact Us meta tags?

I have create ContactUs.php under classes/XLite/Module/XC/CustomSkin/Controller/Customer/
but did not find this module name under /admin.php?target=addons_list_installed
  #6  
Old 02-16-2016, 07:58 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How to modify Contact Us meta tags?

Do you see in under /admin.php?target=addons_list_installed&substring=c ustom%20skin ?

If not, please check if there is the classes/XLite/Module/XC/CustomSkin/Main.php file.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions

Last edited by qualiteam : 02-16-2016 at 08:00 AM.
  #7  
Old 02-16-2016, 02:02 PM
 
www.cheapglasses.net www.cheapglasses.net is offline
 

Advanced Member
  
Join Date: Dec 2015
Posts: 77
 

Default Re: How to modify Contact Us meta tags?

no Main.php, I have created this file with the following contents, still not working
Code:
<?php // vim: set ts=4 sw=4 sts=4 et: /** * X-Cart * * NOTICE OF LICENSE * * This source file is subject to the software license agreement * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.x-cart.com/license-agreement.html * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to licensing@x-cart.com so we can send you a copy immediately. * * DISCLAIMER * * Do not modify this file if you wish to upgrade X-Cart to newer versions * in the future. If you wish to customize X-Cart for your needs please * refer to http://www.x-cart.com/ for more information. * * @category X-Cart 5 * @author Qualiteam software Ltd <info@x-cart.com> * @copyright Copyright (c) 2011-2015 Qualiteam software Ltd <info@x-cart.com>. All rights reserved * @license http://www.x-cart.com/license-agreement.html X-Cart 5 License Agreement * @link http://www.x-cart.com/ */ namespace XLite\Module\XC\CanadaPost; /** * Canada Post module main class * */ abstract class Main extends \XLite\Module\AModule { /** * Author name * * @return string */ public static function getAuthorName() { return 'X-Cart team'; } /** * Module name * * @return string */ public static function getModuleName() { return 'Canada Post'; } /** * Get module major version * * @return string */ public static function getMajorVersion() { return '5.2'; } /** * Get minor core version which is required for the module activation * * @return string */ public static function getMinorRequiredCoreVersion() { return '7'; } /** * Module version * * @return string */ public static function getMinorVersion() { return '8'; } /** * Module description * * @return string */ public static function getDescription() { return 'Gets shipping quotes for Canada Post delivery methods.'; } /** * Determines if we need to show settings form link * * @return boolean */ public static function showSettingsForm() { return true; } /** * Return link to settings form * * @return string */ public static function getSettingsForm() { return \XLite\Core\Converter::buildURL('capost'); } /** * Perform some actions at startup * * @return string */ public static function init() { parent::init(); // Register CanadaPost shipping processor \XLite\Model\Shipping::getInstance()->registerProcessor( '\XLite\Module\XC\CanadaPost\Model\Shipping\Processor\CanadaPost' ); } /** * The module is defined as the shipping module * * @return integer|null */ public static function getModuleType() { return static::MODULE_TYPE_SHIPPING; } /** * Return true if module should work in strict mode * (strict mode enables the logging of errors like 'The module is not configured') * * @return boolean */ public static function isStrictMode() { return false; } }
  #8  
Old 02-16-2016, 02:59 PM
 
www.cheapglasses.net www.cheapglasses.net is offline
 

Advanced Member
  
Join Date: Dec 2015
Posts: 77
 

Default Re: How to modify Contact Us meta tags?

solved.

Re-deploy your store via the admin area of your X-Cart, this is very important, after I re-deploy www.cheapeyeglasses.net, I got what I need.

Detailed steps, pls visit http://kingphp.com at http://kingphp.com/411.html

The following user thanks www.cheapglasses.net for this useful post:
qualiteam (02-16-2016)
  #9  
Old 02-17-2016, 03:40 PM
  razortw's Avatar 
razortw razortw is offline
 

X-Cart team
  
Join Date: Feb 2015
Posts: 807
 

Default Re: How to modify Contact Us meta tags?

You can actually redefine the default meta description via a language label, no need to write a module.
The one you are looking for is 'default-meta-description'.
__________________
Best regards,
Igor Pudovkin
X-Cart hosting team
  #10  
Old 02-17-2016, 03:48 PM
 
www.cheapglasses.net www.cheapglasses.net is offline
 

Advanced Member
  
Join Date: Dec 2015
Posts: 77
 

Default Re: How to modify Contact Us meta tags?

Quote:
Originally Posted by razortw
You can actually redefine the default meta description via a language label, no need to write a module.
The one you are looking for is 'default-meta-description'.

good idea
Closed Thread
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:55 PM.

   

 
X-Cart forums © 2001-2020