Jump to content

Tools.php override on getHomeMetaTags not working


Recommended Posts

Hi guys,

 

Something really simple isn't working and its driving me nuts.

 

I'm trying to override the Tools::getHomeMetaTags function so that the home page title will not include '- Store Name' tagged onto the end, and will only to show what is written in the SEO & URLs section of the back office.

 

This is my override/classes/Tools.php file:

 

<?php
class Tools extends ToolsCore
{
/**
* Get meta tags for a given page
*
* @param integer $id_lang Language id
* @return array Meta tags
*/
public static function getHomeMetaTags($id_lang, $page_name)
{
 /* Metas-tags */
 $metas = Meta::getMetaByPage($page_name, $id_lang);
 $ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? $metas['title'] : Configuration::get('PS_SHOP_NAME');
 $ret['meta_description'] = (isset($metas['description']) AND $metas['description']) ? $metas['description'] : '';
 $ret['meta_keywords'] = (isset($metas['keywords']) AND $metas['keywords']) ? $metas['keywords'] :  '';
 return $ret;
}
}

 

It is basically exactly the same as the original function, with the following removed:

.' - '.Configuration::get('PS_SHOP_NAME')

 

This works fine when editing the core file directly, but isn't picked up as an override.

 

What am I missing?

 

Thanks,

 

Mark

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...