diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index 464f097e8..8d4402271 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -25,8 +25,8 @@ const ProductCard: FC = ({ {variant === 'slim' ? (
-
- +
+ {product.name}
diff --git a/framework/shopify/lib/normalize.ts b/framework/shopify/lib/normalize.ts index ff2de330c..c84a9da1c 100644 --- a/framework/shopify/lib/normalize.ts +++ b/framework/shopify/lib/normalize.ts @@ -22,14 +22,17 @@ const normalizeProductOption = ({ name: displayName, values, ...rest -}: ProductOption) => ({ - __typename: 'MultipleChoiceOption', - displayName, - values: values.map((value) => ({ - label: value, - })), - ...rest, -}) +}: ProductOption) => { + return { + __typename: 'MultipleChoiceOption', + displayName, + values: values.map((value) => ({ + label: value, + hexColors: displayName === 'Color' ? [value] : null, + })), + ...rest, + } +} const normalizeProductImages = ({ edges }: ImageConnection) => edges?.map(({ node: { originalSrc: url, ...rest } }) => ({ diff --git a/framework/shopify/product/get-product.ts b/framework/shopify/product/get-product.ts index 84e74c611..e5a5469c0 100644 --- a/framework/shopify/product/get-product.ts +++ b/framework/shopify/product/get-product.ts @@ -29,6 +29,8 @@ const getProduct = async (options: { const product = data?.productByHandle + console.info(normalizeProduct(product)) + return { product: product ? normalizeProduct(product) : null, }