How to fix the Shopify Invalid enum value in field "availability" Schema error in Google Search Console and the structured data testing tool.
View attachment 72
Find the following line in the product schema snippet:
Replace with:
Save the liquid file and rerun the structured data testing tool. It should now validate. If the Shopify product schema JSON-LD did not validate for you, it could be the case that another issue within the product schema markup needs addressing. Reach out to me if you need a freelancer to help out.
View attachment 72
Find the following line in the product schema snippet:
Code:
"availability": {%- if product.available -%}"//schema.org/InStock"{%- else -%}"//schema.org/OutOfStock"{%- endif -%},
Replace with:
Code:
"availability": "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
Save the liquid file and rerun the structured data testing tool. It should now validate. If the Shopify product schema JSON-LD did not validate for you, it could be the case that another issue within the product schema markup needs addressing. Reach out to me if you need a freelancer to help out.