Jump to content

Call product's short description in metadescription


Recommended Posts

Hi ! 

 

I would like to know how to call in the "meta-description" 's content -> the short description of the product page.
I want an automatic meta-description and to put the short description of the product as the meta description for product page. 
 
I tried this : but it's not working : 
{if $page_name =='product' }
<meta name="description" content="{$short_description|truncate:150:"...":true} - {$shop_name|strip_tags}" />
{/if}
 
 
Can someone help me please :)
Link to comment
Share on other sites

Try this way:

 



{if $page_name == 'product' && isset($product)}
    <meta name="description" content="{$product->description_short|truncate:150:"...":true} - {$shop_name|strip_tags}" />
{elseif isset($meta_description) AND $meta_description}
    <meta name="description" content="{$meta_description|escape:'html':'UTF-8'}" />
{/if}

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