Dim Dukov Posted August 14, 2012 Share Posted August 14, 2012 Hi, guys a long time i'm looking for a solution to this problem. Google webmaster tool show me duplicate meta tag on my category or best-sales pages, like this: URL/11-category-name URL/11-category-name?p=1 URL/11-category-name?p=2 I read on this site how to fix it CLICK Open /classes/Tools.php and replace the function completeMetaTags (around line #500) with the function below. static public function completeMetaTags($metaTags, $defaultValue) { global $cookie; $no_duplication = ""; if (self::getValue('p')) $no_duplication .= ($no_duplication != ""?" #":"#").self::getValue('p'); if ($no_duplication != "") $no_duplication = " (".$no_duplication.")"; if ($metaTags['meta_title'] == NULL) $metaTags['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$defaultValue; $metaTags['meta_title'] .= $no_duplication; if ($metaTags['meta_description'] == NULL) $metaTags['meta_description'] = (Configuration::get('PS_META_DESCRIPTION', intval($cookie->id_lang)) ? Configuration::get('PS_META_DESCRIPTION', intval($cookie->id_lang)) : ''); $metaTags['meta_description'] .= $no_duplication; if ($metaTags['meta_keywords'] == NULL) $metaTags['meta_keywords'] = Configuration::get('PS_META_KEYWORDS', intval($cookie->id_lang)) ? Configuration::get('PS_META_KEYWORDS', intval($cookie->id_lang)) : ''; return $metaTags; } Open /classes/Tools.php and replace the function getHomeMetaTags (around line #490) with the function below. static public function getHomeMetaTags($id_lang) { global $cookie, $page_name; /* Metas-tags */ $metas = Meta::getMetaByPage($page_name, $id_lang); $ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? Configuration::get('PS_SHOP_NAME').' - '.$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'] : ''; $no_duplication = ""; if (self::getValue('p')) $no_duplication .= ($no_duplication != ""?" #":"#").self::getValue('p'); if ($no_duplication != "") { $ret['meta_title'] .= " (".$no_duplication.")"; $ret['meta_description'] .= " (".$no_duplication.")"; } return $ret; } This correction solve double meta tag on pages, but open new problem - i lose my meta tags and meta description on pages like: best-sales, price-drop etc. Please help a colleague. i search for man who understands the source code and want help me for solving this problem. P.S. sorry for my poor language Regard Dim Link to comment Share on other sites More sharing options...
Dim Dukov Posted August 15, 2012 Author Share Posted August 15, 2012 some help please Link to comment Share on other sites More sharing options...
Dim Dukov Posted August 16, 2012 Author Share Posted August 16, 2012 help me please Link to comment Share on other sites More sharing options...
Dim Dukov Posted August 19, 2012 Author Share Posted August 19, 2012 please friends, help me Link to comment Share on other sites More sharing options...
Dim Dukov Posted August 21, 2012 Author Share Posted August 21, 2012 any idea? Link to comment Share on other sites More sharing options...
viktor123 Posted September 29, 2012 Share Posted September 29, 2012 this might help http://www.prestashop.com/forums/topic/188820-adding-page-2-in-meta-description/ Link to comment Share on other sites More sharing options...
Recommended Posts