webbusiness23 Posted November 21, 2010 Share Posted November 21, 2010 Hi,i'd like to change my homepage and my product page title.Homepage: from "My site name" to "keyword_i_choose".Product page to: "product name" (no dashes, no site name needed)How can i do that?Thanks! Link to comment Share on other sites More sharing options...
shokinro Posted November 21, 2010 Share Posted November 21, 2010 I think you change home page title at back officePreferences - Meta-TagsBut for product page, they are getting from product_lang table dynamicly. You need to change product data orYou will need to make some changes in /classes/Product.php file. Link to comment Share on other sites More sharing options...
webbusiness23 Posted November 28, 2010 Author Share Posted November 28, 2010 Any other suggestions, please? Link to comment Share on other sites More sharing options...
rocky Posted November 29, 2010 Share Posted November 29, 2010 You can edit the product page title on the "1. Info." tab of the product editor. Click the "Click here to improve product's rank in search engines (SEO)" link (above the short description), then enter the page title in the "Meta title" field.Go to Preferences > Meta-Tags, then edit "index.php" to enter a meta-title for the homepage.There is no option in PrestaShop to remove the shop name from the meta-title. You will have to manually edit classes/Tools.php to do that. Search for and delete the following code: .' - '.Configuration::get('PS_SHOP_NAME') 2 Link to comment Share on other sites More sharing options...
webbusiness23 Posted December 2, 2010 Author Share Posted December 2, 2010 I found this line $row['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$row['meta_title']; located at the /* CMS specifics meta tags */ , but i couldn't find anything related to the product's page / title.Could you help me further, please? Link to comment Share on other sites More sharing options...
rocky Posted December 3, 2010 Share Posted December 3, 2010 It's the following code on lines 471-485 (in PrestaShop v1.3.2): /* Products specifics meta tags */ if ($id_product = self::getValue('id_product')) { $row = Db::getInstance()->getRow(' SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description_short` FROM `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`) WHERE pl.id_lang = '.intval($id_lang).' AND pl.id_product = '.intval($id_product).' AND p.active = 1'); if ($row) { if (empty($row['meta_description'])) $row['meta_description'] = strip_tags($row['description_short']); return self::completeMetaTags($row, $row['name']); } } which calls the completeMetaTags function: static public function completeMetaTags($metaTags, $defaultValue) { global $cookie; if ($metaTags['meta_title'] == NULL) $metaTags['meta_title'] = $defaultValue.' - '.Configuration::get('PS_SHOP_NAME'); 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)) : ''; 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; } So try changing removing the shop name on the sixth line above. Link to comment Share on other sites More sharing options...
webbusiness23 Posted December 3, 2010 Author Share Posted December 3, 2010 I removed Configuration::get('PS_SHOP_NAME') and it worked.Thank you! Link to comment Share on other sites More sharing options...
prestalollo Posted January 6, 2011 Share Posted January 6, 2011 How can I add category + shop_name to <title> for a product, like"Product1 - Category 1 - Shop"How can I add shop_name to a category title, like"Category - Shop"Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now