Having Trouble Saving JSON Schema for My Shopify Product

0
1
Asked By CuriousCactus92 On

I'm trying to enhance my Shopify website by adding a product schema but I'm running into issues. I've written out the JSON but it just won't save, even though it validates correctly through a JSON validator. Here's the code I'm trying to implement:

{
"@context": "https://schema.org/",
"@type": "Product",
"name": "{{ product.title }}",
"description": "{{ product.description | strip_html | escape }}",
"image": "{{ product.featured_image | img_url: 'original' | prepend: 'https:' }}",
"url": "{{ shop.url }}{{ product.url }}",
"sku": "{{ product.sku }}",
"offers": {
"@type": "Offer",
"priceCurrency": "USD",
"price": "{{ product.price | money_without_currency }}",
"availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
"itemCondition": "https://schema.org/NewCondition"
},
"brand": {
"@type": "Brand",
"name": "Chloé Duncan"
}
}

I really don't know what I'm missing and it's getting frustrating trying to save it within Shopify only for it to reject with a "JSON error." Any advice would be appreciated!

2 Answers

Answered By SchemaNinja44 On

Looks like you might be dealing with an invalid schema issue! Double-check if you're adding the JSON schema in the right liquid file. It could be that the location is incorrect or that you're missing a schema tag. Have a look at the link below; it might offer some insights on fixing that error:
https://community.shopify.com/t/how-to-fix-invalid-json-in-tag-schema-error/32717/6

Answered By CodeScribe72 On

It can be tricky figuring it all out! But first off, what specific error message are you getting? Knowing that can help pinpoint the issue better. Also, where exactly in Shopify are you trying to save this schema? If it's not in the right section or if you’re missing a key part, that could be the cause of the problem. Try to clarify those points and see what the error feedback says when you save it.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.