Nizar54 Posted December 9, 2009 Share Posted December 9, 2009 When we open product pages, the title order of the page will beWebsite Name - Name of ProductHow to change the title order intoName of Product - Website nameI try to edit header.tpl, but still can't change it, can someone help me? Link to comment Share on other sites More sharing options...
goosedesign Posted December 9, 2009 Share Posted December 9, 2009 Not sure what the syntax would need to be but try editing around line 471 in classes/Tools.php: $row['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$row['meta_title']; Link to comment Share on other sites More sharing options...
Nizar54 Posted December 10, 2009 Author Share Posted December 10, 2009 I edited that line, but nothing change in my shop,Can someone help me? Link to comment Share on other sites More sharing options...
Nizar54 Posted December 11, 2009 Author Share Posted December 11, 2009 Can someone help me to change the product title please? Link to comment Share on other sites More sharing options...
bhg Posted December 11, 2009 Share Posted December 11, 2009 This may be helpful:http://www.daveegerton.com/home.html Link to comment Share on other sites More sharing options...
Nizar54 Posted December 11, 2009 Author Share Posted December 11, 2009 Okie, thankies bhg, i'll try to find it there Link to comment Share on other sites More sharing options...
eddieuk Posted December 15, 2009 Share Posted December 15, 2009 Does anyone know how to change the Title of the website? Link to comment Share on other sites More sharing options...
rocky Posted December 15, 2009 Share Posted December 15, 2009 You can change the title of the homepage and some other pages by going to Preferences > Meta-Tags, clicking the Edit button next to a page, then change the "Page's title" field. You can change the title of the CMS pages by going to Tools > CMS, clicking the Edit button next to a page, then changing the "Meta title" field. You can change the title of the products by going to to the product editor and clicking "Click here to improve product's rank in search engines (SEO)", then changing the "Meta title". To change the format of the title from "Shop Name - Title" to "Title | Shop Name", for example, like goosedesign said above, change line 471 of classes/Tools.php from: $row['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$row['meta_title']; to: $row['meta_title'] = $row['meta_title'].' | '.Configuration::get('PS_SHOP_NAME'); and line 493 from: $ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? Configuration::get('PS_SHOP_NAME').' - '.$metas['title'] : Configuration::get('PS_SHOP_NAME'); to: $ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? $metas['title'].' | '.Configuration::get('PS_SHOP_NAME') : Configuration::get('PS_SHOP_NAME'); and line 505 from: $metaTags['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$defaultValue; to: $metaTags['meta_title'] = $defaultValue.' | '.Configuration::get('PS_SHOP_NAME'); Link to comment Share on other sites More sharing options...
eddieuk Posted December 15, 2009 Share Posted December 15, 2009 You can change the title of the homepage and some other pages by going to Preferences > Meta-Tags, clicking the Edit button next to a page, then change the "Page's title" field. You can change the title of the CMS pages by going to Tools > CMS, clicking the Edit button next to a page, then changing the "Meta title" field. You can change the title of the products by going to to the product editor and clicking "Click here to improve product's rank in search engines (SEO)", then changing the "Meta title". To change the format of the title from "Shop Name - Title" to "Title | Shop Name", for example, like goosedesign said above, change line 471 of classes/Tools.php from: $row['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$row['meta_title']; to: $row['meta_title'] = $row['meta_title'].' | '.Configuration::get('PS_SHOP_NAME'); and line 493 from: $ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? Configuration::get('PS_SHOP_NAME').' - '.$metas['title'] : Configuration::get('PS_SHOP_NAME'); to: $ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? $metas['title'].' | '.Configuration::get('PS_SHOP_NAME') : Configuration::get('PS_SHOP_NAME'); and line 505 from: $metaTags['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$defaultValue; to: $metaTags['meta_title'] = $defaultValue.' | '.Configuration::get('PS_SHOP_NAME'); Many thanks! Very helpful! Link to comment Share on other sites More sharing options...
snoon Posted December 29, 2009 Share Posted December 29, 2009 sorry i do it butPHP Warning: Cannot modify header information - headers already sent by (output started at /classes/Tools.php:1) in /header.php on line 4PHP Warning: Cannot modify header information - headers already sent by (output started at /classes/Tools.php:1) in /classes/Cookie.php on line 261PHP Warning: Cannot modify header information - headers already sent by (output started at /classes/Tools.php:1) in /classes/Cookie.php on line 261PHP Warning: Cannot modify header information - headers already sent by (output started at /classes/Tools.php:1) in /order.php on line 12PHP Warning: Cannot modify header information - headers already sent by (output started at /classes/Tools.php:1) in /order.php on line 13PHP Warning: Cannot modify header information - headers already sent by (output started at /classes/Tools.php:1) in /classes/Tools.php on line 42 Link to comment Share on other sites More sharing options...
rocky Posted December 29, 2009 Share Posted December 29, 2009 I cannot see how the changes I suggested would cause that error, since they are only moving existing variables around on the same line. Try changing those lines back to what they were originally and check whether the error disappears or is still there. Link to comment Share on other sites More sharing options...
snoon Posted December 29, 2009 Share Posted December 29, 2009 changing those lines back to what they were originally and check , the error disappears./header.php on line 4-----------header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');---------------i don't know what is this Link to comment Share on other sites More sharing options...
rocky Posted December 29, 2009 Share Posted December 29, 2009 I just retested my code and was unable to reproduce your issue. Sorry, I don't know why it isn't working for you. Link to comment Share on other sites More sharing options...
snoon Posted December 29, 2009 Share Posted December 29, 2009 thanksmy prestashop is Version 1.2.5.0this error_log in my ftp-foot lots of thanks Link to comment Share on other sites More sharing options...
technomatters Posted April 5, 2010 Share Posted April 5, 2010 Really helpful, thanksI tried it for my store and its working fine now. Link to comment Share on other sites More sharing options...
smooth Posted April 7, 2010 Share Posted April 7, 2010 Hi,I am using 1.2.5.0 as well, and after making the changes I am having the same problem as well in the error logs:PHP Warning: Cannot modify header information - headers already sent by (output started at public_html/classes/Tools.php:1) in public_html/header.php on line 4and when I click on my account, it loads a black page with view source "1" only, and nothing else and I am unable to update any products etc as well. In fact, I tried modifying the codes in 1.2.5.0 and it doesnt work, so I just try to change something minimum, like changing the .' | '. to .' - '. only, and I am getting the exact same error, is it because something like after I change the few lines of codes (even by a bit only), the other codes couldnt detect this and hence it is not working? anyone managed to solved the issue in 1.2.5.0 on changeing the Store name - Title, to , Title - Store name?Hope someone can please share how to make it work.... thank you very much! Link to comment Share on other sites More sharing options...
smooth Posted April 8, 2010 Share Posted April 8, 2010 guys anyone happens to use 1.2.5.0 and make the changes to the title tag by changing the arrangment or removing the store name? prestashop doesnt seems to allow me to change anything in the tools.php, strange Link to comment Share on other sites More sharing options...
airbag Posted June 9, 2010 Share Posted June 9, 2010 Hello, I am using 1.2.5 also and have a question about these title tags.When on a category page, the shop name is displayed, then the title is displayed...but when on a product page, there is no shop name showing, only the product name.How can I add the shop name to display also on the product pages.Thanks, Link to comment Share on other sites More sharing options...
rocky Posted June 10, 2010 Share Posted June 10, 2010 You'll need to modify the completeMetaTags function in classes/Tools.php. I think this should do the trick. Change lines 556-557 from: if ($metaTags['meta_title'] == NULL) $metaTags['meta_title'] = $defaultValue.' - '.Configuration::get('PS_SHOP_NAME'); to: if ($metaTags['meta_title'] == NULL) $metaTags['meta_title'] = $defaultValue.' - '.Configuration::get('PS_SHOP_NAME'); else $metaTags['meta_title'] .= ' - '.Configuration::get('PS_SHOP_NAME'); Link to comment Share on other sites More sharing options...
airbag Posted June 11, 2010 Share Posted June 11, 2010 Rocky, thanks for the info on this. In that file I do not have the code you mentioned, instead I have similar code on line 500 of that file: 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'] : ''; return $ret; } static public function completeMetaTags($metaTags, $defaultValue) { global $cookie; if ($metaTags['meta_title'] == NULL) $metaTags['meta_title'] = Configuration::get('PS_SHOP_NAME').' - '.$defaultValue; 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; } Link to comment Share on other sites More sharing options...
rocky Posted June 12, 2010 Share Posted June 12, 2010 You must be using a different version of PrestaShop than me. The line numbers are different, but the code is the same. Change the third and fourth line of the completeMetaTags function to my code above. Link to comment Share on other sites More sharing options...
airbag Posted June 12, 2010 Share Posted June 12, 2010 Thanks for your reply Rocky, worked a treat! Link to comment Share on other sites More sharing options...
Badbwoy Posted January 17, 2011 Share Posted January 17, 2011 I now have displayed in this formProduct - Shop nameand how to make asBrand Product - Shop nameHelp please ) Link to comment Share on other sites More sharing options...
rocky Posted January 17, 2011 Share Posted January 17, 2011 The only way I can think of to do that is to add the following before the $smarty->display at the bottom of header.php: if (isset($_GET['id_product'])) { $product = new Product(intval($_GET['id_product']), true, intval($cookie->id_lang)); if (Validate::isLoadedObject($product)) $smarty->assign('manufacturer_name', $product->manufacturer_name); } then change line 4 of header.tpl in your theme's directory from: <title>{$meta_title|escape:'htmlall':'UTF-8'}</title> to: <title>}if isset($manufacturer_name)}{$manufacturer_name} {/if}{$meta_title|escape:'htmlall':'UTF-8'}</title> Link to comment Share on other sites More sharing options...
Badbwoy Posted January 17, 2011 Share Posted January 17, 2011 by adding code to header.php site falls. Link to comment Share on other sites More sharing options...
rocky Posted January 17, 2011 Share Posted January 17, 2011 I fixed an error in my code above. Try again. Link to comment Share on other sites More sharing options...
Badbwoy Posted January 17, 2011 Share Posted January 17, 2011 it works!!! many thanx!#OFFTOPIC#can you know how to fix a search engine? after importing from CSV site displays only half of the products. Link to comment Share on other sites More sharing options...
sannie Posted April 10, 2012 Share Posted April 10, 2012 Hi Rocky, I'm using custom made pages (by adding 2 files for each page: say custom.php and custom.tpl as described here http://www.prestashop.com/forums/topic/52650-how-to-add-a-custom-page/). Unfortunately the example didn't explain how to include the title of pages. Do you know how I can hardcode the title in a custom page? Thanks in advance! Link to comment Share on other sites More sharing options...
RoooM Posted August 14, 2012 Share Posted August 14, 2012 how to get the title category, where the id = 5 Thanks Link to comment Share on other sites More sharing options...
Rbn_R Posted January 7, 2013 Share Posted January 7, 2013 Hi guys, I want change title format. Rocky wrote here perfect solution (edit lines in classes/Tools.php), but I can not find these lines in PS 1.5.2. Where are they in new version? I want this: "Title | Shop Name" Thanks Link to comment Share on other sites More sharing options...
barracuda28 Posted March 8, 2015 Share Posted March 8, 2015 Hi guys, Does anyone know how to open the source code for index.php? I need to modify it. Thanks. Barracuda Link to comment Share on other sites More sharing options...
quito Posted May 27, 2015 Share Posted May 27, 2015 Hello, Here in new version of Prestashop (1.6) is option to make it from admin panel? without modification source code? Link to comment Share on other sites More sharing options...
Virous.2016 Posted July 5, 2017 Share Posted July 5, 2017 (edited) Hi i wanted to change of my title Display Mode Structure : Now My Display Mode Structure is : Name of Categories | Website name but now i wanted just show Name of Categories and dont show Website nameHow to change the title order into my web site ? my prestashop vertion is 1.6.1.7 my web site address : https://irandec.com Edited July 5, 2017 by Virous.2016 (see edit history) 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