dediagency / sylius-seo-plugin

Sylius SEO Plugin by Dedi.
26 stars 24 forks source link

Variants disabled still appears in rich_snippets #71

Open cbastienbaron opened 2 months ago

cbastienbaron commented 2 months ago

Hi :vulcan_salute: ,

First, thanks guys for this plugin, thats save hours of life :)

now the issue :

Seems when a variant is disabled, he's still appears in the block

<!-- BEGIN BLOCK | event name: "dedi_sylius_seo_plugin.rich_snippets", block name: "dedi_seo_metatags", template: "@DediSyliusSEOPlugin/Shop/Header/_richSnippets.html.twig", priority: 0 -->

<script type="application/ld+json">[{"@context":"https://schema.org","@type":"Product","name":"Product","description":null,"gtin13":"7610137298367","offers":[
{
"@type":"Offer",
"url":"http://127.0.0.1/fr_FR/products/test-1017",
"priceCurrency":"CHF",
"price":"20.0",
"availability":"https://schema.org/InStock"
},
{
"@type":"Offer","url":"http://127.0.0.1/fr_FR/products/test-1017",
"priceCurrency":"CHF",
"price":"5.9",
"availability":"https://schema.org/InStock"
} // <== We dont want u, u r disabled

]}]</script> 

here, there is only one variant enable for this product (the second is disable, and must not appears on product page). There is a config for this ? or need a pr to fix this ?