diff --git a/app/routes/products.$handle/route.jsx b/app/routes/products.$handle/route.jsx index a0dfe7a..9c70c35 100644 --- a/app/routes/products.$handle/route.jsx +++ b/app/routes/products.$handle/route.jsx @@ -132,7 +132,7 @@ export default function Product() { {(data) => ( - + data.product?.solution != null ? : null )} @@ -142,13 +142,13 @@ export default function Product() { {(data) => ( - + data.product?.relatedProducts != null ? : null )} - {(data) => } + {(data) => data.product?.spotlight != null ? : null} diff --git a/app/routes/products.$handle/sections/hero.jsx b/app/routes/products.$handle/sections/hero.jsx index 042b3fd..b89ceaa 100644 --- a/app/routes/products.$handle/sections/hero.jsx +++ b/app/routes/products.$handle/sections/hero.jsx @@ -65,15 +65,15 @@ function ProductSummary() { const accordionData = [ { title: 'Materials', - content: product.materials.value, + content: product.materials?.value, }, { title: 'Care Instructions', - content: product.care_guide.value, + content: product.care_guide?.value, }, { title: 'Fit', - content: product.fit.value, + content: product.fit?.value, }, ]; diff --git a/app/routes/products.$handle/sections/highlight-details.jsx b/app/routes/products.$handle/sections/highlight-details.jsx index 530288a..10a6ab3 100644 --- a/app/routes/products.$handle/sections/highlight-details.jsx +++ b/app/routes/products.$handle/sections/highlight-details.jsx @@ -6,7 +6,7 @@ import {Image} from '@shopify/hydrogen'; export default function HighlightDetails() { const {details} = useLoaderData(); - if (!details) return null; + if (details?.features == null) return null; const {highlights} = JSON.parse(details.features.reference.content.value); diff --git a/app/routes/products.$handle/sections/reviews.jsx b/app/routes/products.$handle/sections/reviews.jsx index d5b60ef..f52edda 100644 --- a/app/routes/products.$handle/sections/reviews.jsx +++ b/app/routes/products.$handle/sections/reviews.jsx @@ -6,6 +6,10 @@ import {cva, cx} from '@h2/new/utils'; export default function Reviews({data}) { const {review_count, review_avg, reviews} = data.reviews; + if (reviews == null) { + return null + } + const customerReviews = reviews.references.nodes; return (