prestarocket-agence / classic-rocket

Classic Rocket is a rework of "classic theme". It has been built keeping in mind : performance, accessibility and SEO.
https://demoprestashop.prestarocket.com/
Other
229 stars 127 forks source link

Issue with metadata and Facebook Pixel #86

Closed msaustral closed 5 years ago

msaustral commented 5 years ago

Hi everyone, there is an issue with the metadata in the templates -> _partials -> microdata-jsonld.tpl

On line 31 does not validate if the page is a product and insert the logo as first image product on the Facebook pixel

To solve this issue change the line 31

<meta property="og:image" content="{$urls.shop_domain_url}{$shop.logo}"/>

for this code:

{if $page.page_name =='index'}
    <meta property="og:image" content="{$urls.shop_domain_url}{$shop.logo}"/>
{/if}
{if isset($product) && $page.page_name == 'product'}
    {if $product.images|count > 0}
        {foreach from=$product.images item=p_img name="p_img_list"}
            <meta property="og:image" content="{$p_img.large.url}"/>
            {if not $smarty.foreach.p_img_list.last},{/if}
        {/foreach}
    {/if}
{/if}

Problem solved!