We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be great to show how to implement google rich snippets using the summaryData in the Hydrogen demo store, similar to this:
summaryData
https://support.okendo.io/en/articles/3813081-set-up-google-rich-snippets-for-product-ratings
The text was updated successfully, but these errors were encountered:
Here is how I did it so far:
Add this to your product query:
reviewsData: metafield(namespace: "okendo", key: "summaryData") { value type }
Then in your loader:
loader
type ReviewsData = { reviewAverageValue: number; reviewCount: number; }; let reviewsData: ReviewsData | null; try { reviewsData = product?.reviewsData?.value ? (JSON.parse(product.reviewsData.value) as ReviewsData) : null; } catch (error) { console.error('Failed to parse reviews data:', error); reviewsData = null; } const aggregateRating = { '@type': 'AggregateRating', ratingValue: reviewsData?.reviewAverageValue ?? 5, ratingCount: reviewsData?.reviewCount ?? 1, };
Sorry, something went wrong.
Hi Octave, indeed we can definitely do that. We should be able to work on it soon. Thanks for the suggestion!
No branches or pull requests
It would be great to show how to implement google rich snippets using the
summaryData
in the Hydrogen demo store, similar to this:https://support.okendo.io/en/articles/3813081-set-up-google-rich-snippets-for-product-ratings
The text was updated successfully, but these errors were encountered: