Wednesday, June 14, 2017

Prestashop add keywords from tags for products

Here is a little code to be added to header.tpl if you want to add the meta keywords ofr a product page

 

  {if isset($product->tags) AND $product->tags}
   {if isset($product->tags[$cart->id_lang]) AND $product->tags[$cart->id_lang]}
    <meta name="keywords" content="
     {foreach from=$product->tags[$cart->id_lang] item=foo}
     {$foo|escape:'html':'UTF-8'};
     {/foreach}
     " />
   {/if}  
  {/if}