From f20771a2c38603c81cb3c13df513f5383015f948 Mon Sep 17 00:00:00 2001 From: cond0r Date: Mon, 5 Apr 2021 18:31:20 +0300 Subject: [PATCH] Add product descriptionHtml --- components/product/ProductView/ProductView.tsx | 2 +- framework/commerce/types.ts | 1 + framework/shopify/README.md | 11 +---------- framework/shopify/utils/normalize.ts | 2 ++ .../shopify/utils/queries/get-all-products-query.ts | 1 + 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index 89c69734f..2258f3be9 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -136,7 +136,7 @@ const ProductView: FC = ({ product }) => { ))}
- +
diff --git a/framework/commerce/types.ts b/framework/commerce/types.ts index ccb8572aa..8973e0d63 100644 --- a/framework/commerce/types.ts +++ b/framework/commerce/types.ts @@ -165,6 +165,7 @@ interface Entity { export interface Product extends Entity { name: string description: string + descriptionHtml?: string slug?: string path?: string images: ProductImage[] diff --git a/framework/shopify/README.md b/framework/shopify/README.md index eeae73afc..987f49b56 100644 --- a/framework/shopify/README.md +++ b/framework/shopify/README.md @@ -24,18 +24,9 @@ Collection of hooks and data fetching functions to integrate Shopify in a React ## Getting Started -1. Install dependencies: +1. Environment variables need to be set: ``` -yarn add shopify-buy -yarn add @types/shopify-buy -``` - -3. Environment variables need to be set: - -``` -SHOPIFY_STORE_DOMAIN= -SHOPIFY_STOREFRONT_ACCESS_TOKEN= NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN= NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN= ``` diff --git a/framework/shopify/utils/normalize.ts b/framework/shopify/utils/normalize.ts index d25b7548c..a3f9cec7e 100644 --- a/framework/shopify/utils/normalize.ts +++ b/framework/shopify/utils/normalize.ts @@ -93,6 +93,7 @@ export function normalizeProduct(productNode: ShopifyProduct): Product { images, variants, description, + descriptionHtml, handle, priceRange, options, @@ -104,6 +105,7 @@ export function normalizeProduct(productNode: ShopifyProduct): Product { name, vendor, description, + descriptionHtml, path: `/${handle}`, slug: handle?.replace(/^\/+|\/+$/g, ''), price: money(priceRange?.minVariantPrice), diff --git a/framework/shopify/utils/queries/get-all-products-query.ts b/framework/shopify/utils/queries/get-all-products-query.ts index f9ec72e83..bf5f7bffe 100644 --- a/framework/shopify/utils/queries/get-all-products-query.ts +++ b/framework/shopify/utils/queries/get-all-products-query.ts @@ -10,6 +10,7 @@ edges { vendor handle description + descriptionHtml availableForSale priceRange { minVariantPrice {