Liquid, JavaScript, themes, sales channels
I want to resolve this: "This Product is missing a global identifier (e.g. isbn, mpn or gtin8)" for Google structured data. But Shopify does not have field MPN. Can i (and how to) set mpn to use first product tag? In my case there are three, first is vendor , second unique and represents manufacturers part number, third is type for category. Example: WesternDigital, WD5000BMVW, HDD
If you want to use certain tags for specific purposes, it helps to add a prefix to your tag, like "mpn-1234567890". Then in your rich snippets code, you can get it like this:
{%- for tag in product.tags -%}
{%- if tag contains 'mpn-' -%}
{%- assign productMPN = tag | remove: 'mpn-' -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
Rich snippet ld+json code...
"mpn": "{{ productMPN }}"
Thank you, that's awesome answer. I am not programmer, but i dig it, however it's a lot of tags and collection rules to edit. Is it possible to modify code to use tag that has no XthatX, XorthatX, XoreventhatX? Because other tags tend to repeat, would be much easier to create "ignore" list.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024