Here’s a detailed step-by-step approach to resolve the issue:
Missing Field “hasMerchantReturnPolicy” (in “offers”)
Even for digital products, you can include a return policy.
Here’s how to do it:
Navigate to Settings > Policies in your Shopify admin. Add your return policy details and save.
Incorporate Return Policy into Structured Data:
Go to Online Store > Themes in your Shopify admin. Click Actions > Edit Code for your active theme.
Locate the file where your product structured data (JSON-LD) is defined, commonly in product-template.liquid.
Within the JSON-LD script, add:
“hasMerchantReturnPolicy”: {
“@type”: “MerchantReturnPolicy”,
“url”: “{{ shop.url }}/policies/refun-policy”
}
Replace {{ shop.url }}/policies/refun-policy with the actual URL of your return policy page.
Missing Field “shippingDetails” (in “offers”)
Add Shipping Details to Structured Data:
In the same JSON-LD script, include:
“shippingDetails”: {
“@type”: “OfferShippingDetails”,
“shippingRate”: {
“@type”: “MonetaryAmount”,
“value”: “0.00”,
“currency”: “USD”
},
“shippingDestination”: {
“@type”: “DefinedRegion”,
“addressCountry”: “US”
},
“deliveryTime”: {
“@type”: “ShippingDeliveryTime”,
“handlingTime”: {
“@type”: “QuantitativeValue”,
“minValue”: 0,
“maxValue”: 0,
“unitCode”: “HOUR”
},
“transitTime”: {
“@type”: “QuantitativeValue”,
“minValue”: 0,
“maxValue”: 0,
“unitCode”: “HOUR”
}
}
}
This means that there are no shipping costs or times associated with your products.
Missing Field “priceValidUntil” (in “offers”)
Set a Default Validity Date:
In your JSON-LD script, add:
“priceValidUntil”: “{{ ‘now’ | date: ‘%Y-%m-%d’ | date: ‘%Y’ | plus: 1 }}-12-31”
This sets the price validity until the end of the next calendar year.
Missing Field “aggregateRating”
This pertains to the average rating of your products based on customer reviews:
Implement a Review System: Integrate a review app from the Shopify App Store to collect customer feedback.
Add Aggregate Rating to Structured Data:
Once reviews are collected, modify your JSON-LD script to include:
“aggregateRating”: {
“@type”: “AggregateRating”,
“ratingValue”: “{{ product.metafields.spr.reviews | split: ‘"ratingValue": "’ | last | split: ‘"’ | first }}”,
“reviewCount”: “{{ product.metafields.spr.reviews | split: ‘"reviewCount": "’ | last | split: ‘"’ | first }}”
}
Ensure this data dynamically reflects your product reviews.
Missing Field “review”
Include Individual Reviews in Structured Data:
After collecting reviews, add to your JSON-LD script:
“review”: [
{
“@type”: “Review”,
“author”: {
“@type”: “Person”,
“name”: “{{ review.author }}”
},
“datePublished”: “{{ review.date }}”,
“description”: “{{ review.content }}”,
“name”: “{{ review.title }}”,
“reviewRating”: {
“@type”: “Rating”,
“bestRating”: “5”,
“ratingValue”: “{{ review.rating }}”,
“worstRating”: “1”
}
}
// Repeat for additional reviews
]
Ensure this section dynamically includes actual customer reviews.
If you’re uncomfortable in editing the code, choose apps from shopify app store that can complete the task for you. These apps include Easy edits, coderift, and more.