Shopify fix Invalid enum value in field "availability" Schema

Sitebee

Technical SEO
Staff member
How to fix the Shopify Invalid enum value in field "availability" Schema error in Google Search Console and the structured data testing tool.

Invalid enum value in field availability.PNG



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 an another issue within the product schema markup needs addressing. Reach out to me if you need a freelancer to help out.