From c23a39bb531c45272d558d723d3db8866b3113ad Mon Sep 17 00:00:00 2001 From: abhu-A-J Date: Mon, 15 May 2023 13:16:53 +0530 Subject: [PATCH] fix: add missing offers field into product schema --- app/product/[handle]/page.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/product/[handle]/page.tsx b/app/product/[handle]/page.tsx index 5d8a4297f..69252efc2 100644 --- a/app/product/[handle]/page.tsx +++ b/app/product/[handle]/page.tsx @@ -63,7 +63,16 @@ export default async function ProductPage({ params }: { params: { handle: string '@type': 'Product', name: product.title, description: product.description, - image: product.featuredImage.url + image: product.featuredImage.url, + offers: { + '@type': 'AggregateOffer', + availability: product.availableForSale + ? 'https://schema.org/InStock' + : 'https://schema.org/OutOfStock', + priceCurrency: product.priceRange.minVariantPrice.currencyCode, + highPrice: product.priceRange.maxVariantPrice.amount, + lowPrice: product.priceRange.minVariantPrice.amount + } }; return (