freeman0 Posted May 31, 2012 Share Posted May 31, 2012 Hello! Anyone has an idea how to append current product price to the <title> tag when viewing a product? The title tag is set in header.tpl <title>{$meta_title|escape:'htmlall':'UTF-8'}</title> and the product price is calculated much later in product.tpl {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL)} I cannot modify title in product.tpl because it is already set. I also cannot calculate product price in header.tpl. How can I solve this? Link to comment Share on other sites More sharing options...
canyon88 Posted June 17, 2012 Share Posted June 17, 2012 Hello, I am looking for the same thing, I would like the product price to be implemented automatically in the meta title. I think it's a very good thing because once a customer search in Google the price appear with the title which can help a lot for bring the visitor to your website... Link to comment Share on other sites More sharing options...
freeman0 Posted June 18, 2012 Author Share Posted June 18, 2012 Yes, that's exactly my idea. But I guess it might not be possible since nobody has posted any hint or solution yet. I only managed to achieve this using JavaScript, but unfortunately Google doesn't see it Link to comment Share on other sites More sharing options...
canyon88 Posted October 9, 2012 Share Posted October 9, 2012 Still looking for a solution, anybody can help ? I am sure many shop owner can be interested by this .. Link to comment Share on other sites More sharing options...
evolution.x Posted October 10, 2012 Share Posted October 10, 2012 I am also interested in this, i currently hardcode the price in the meta but it gives me a headache when i have price changes. Regards Link to comment Share on other sites More sharing options...
kikis Posted October 29, 2012 Share Posted October 29, 2012 I am looking for this too!! Anyone? Link to comment Share on other sites More sharing options...
bluestyle Posted September 30, 2016 Share Posted September 30, 2016 (edited) Hello. Does anyone have a solution for this? Edited September 30, 2016 by bluestyle (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted October 1, 2016 Share Posted October 1, 2016 Try: <title>{$meta_title|escape:'html':'UTF-8'}{if isset($smarty.get.id_product) && $smarty.get.id_product|intval > 0} - {convertPrice price=Product::getPriceStatic($smarty.get.id_product|intval)}{/if}</title> 1 Link to comment Share on other sites More sharing options...
bluestyle Posted October 19, 2016 Share Posted October 19, 2016 Works perfect! Thank you! Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 20, 2016 Share Posted October 20, 2016 I would love to suggest to do it with Google Rich Snippets and have the price shown in SERPS like this. Better for SEO. Link to comment Share on other sites More sharing options...
bluestyle Posted October 24, 2016 Share Posted October 24, 2016 How can i do it with Google Rich Snippets? Link to comment Share on other sites More sharing options...
razvy Posted October 8, 2017 Share Posted October 8, 2017 Hi, Great solution, I was looking for that. How about showing the discount percentage in the title? I can't figure it out... Thanks! Link to comment Share on other sites More sharing options...
Jacek Es Posted March 14, 2022 Share Posted March 14, 2022 Hi, This works great! Thank you. I would love to see a modification that instead of the Price a minimum price is displayed based on the quantity discounts. Would this be possible? PrestaShop 1.6 Jacek On 10/1/2016 at 7:24 AM, rocky said: Try: <title>{$meta_title|escape:'html':'UTF-8'}{if isset($smarty.get.id_product) && $smarty.get.id_product|intval > 0} - {convertPrice price=Product::getPriceStatic($smarty.get.id_product|intval)}{/if}</title> Link to comment Share on other sites More sharing options...
razvy Posted March 14, 2022 Share Posted March 14, 2022 Sorry, I don't know how to do it... 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