Jump to content

Include price in meta title


freeman0

Recommended Posts

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

  • 3 weeks later...

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

  • 3 months later...
  • 3 weeks later...
  • 3 years later...
  • 3 weeks later...
  • 11 months later...
  • 4 years later...

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

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...