diff --git a/apps/docs/content/docs/anatomy/pages/pdp.mdx b/apps/docs/content/docs/anatomy/pages/pdp.mdx index acf5637d..980b61a5 100644 --- a/apps/docs/content/docs/anatomy/pages/pdp.mdx +++ b/apps/docs/content/docs/anatomy/pages/pdp.mdx @@ -10,9 +10,9 @@ The Product Detail Page (PDP) gives shoppers the information and controls needed ## Help shoppers choose the right variant -Product pages show the title, price, media, description, and available options. Option choices update the page URL, so shoppers can share a selected color, size, or other variant and use browser back and forward controls. +Product pages show the title, price, media, description, and available options. Option choices update immediately, then the price, availability, and purchase controls confirm when the selected variant resolves. Purchase controls stay disabled during that brief transition so shoppers cannot add the previous variant by mistake. -When colors have distinct media, the gallery leads with the selected color's image. Desktop shoppers get a grid and lightbox; mobile shoppers get a swipeable gallery. +Each choice also updates the page URL, so shoppers can share a selected color, size, or other variant and use browser back and forward controls. When colors have distinct media, the gallery switches immediately to the selected color's image. Desktop shoppers get a grid and lightbox; mobile shoppers get a swipeable gallery. Product updates are cached and refreshed by Shopify webhooks. See [Webhooks](/docs/anatomy/webhooks). diff --git a/apps/template/components/product-detail/buy-buttons.tsx b/apps/template/components/product-detail/buy-buttons.tsx index cbb2bba9..8cbf4d06 100644 --- a/apps/template/components/product-detail/buy-buttons.tsx +++ b/apps/template/components/product-detail/buy-buttons.tsx @@ -5,6 +5,7 @@ import { useTranslations } from "next-intl"; import { useEffect, useState, useTransition } from "react"; import { useCart } from "@/components/cart/context"; +import { useVariantSelection } from "@/components/product-detail/variant-selection-client"; import { Button } from "@/components/ui/button"; import { buyNowAction } from "@/lib/cart/action"; import { variantToOptimisticInfo } from "@/lib/product"; @@ -42,6 +43,7 @@ export function BuyButtons({ title: string; }) { const selectedVariantId = selectedVariant?.id; + const { isPending } = useVariantSelection(); const t = useTranslations("product"); const tCart = useTranslations("cart"); @@ -143,7 +145,7 @@ export function BuyButtons({ ) : null}