Liquid, JavaScript, themes, sales channels
Hello
I use the shopify product reviews w/ the warehouse theme.
In short, I would like to use the standard shopify product reviews form i.e "data-id="{{ product.id }}">{{ product.metafields.spr.reviews }}". However, I do not want it to generate any structured data because it is causing errors on my site.
Is it possible to use shopify product reviews but not have it generate rich snippet data?
btw.. When I remove the form, I get no warnings regarding rich snippets.
Any pointers would be much appreciated.
Check this thread -- there are some ways to do it https://community.shopify.com/c/Technical-Q-A/Either-quot-offers-quot-quot-review-quot-or-quot-aggre...
I read that thread and it have it working! thank you.
inserting the following script
{% if reviews_count > 0 %}
<script>
var target = document.getElementById('shopify-product-reviews')
var observer = new MutationObserver(function(mutations) {
$('#shopify-product-reviews [type="application/ld+json"]').remove();
});
var config = { attributes: true, childList: true, characterData: true };
observer.observe(target, config);
</script>
{%- endif -%}
fixed it for me.
source: https://community.shopify.com/c/Technical-Q-A/Either-quot-offers-quot-quot-review-quot-or-quot-aggre...
This code doesn't work.
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