Add product descriptionHtml

This commit is contained in:
cond0r 2021-04-05 18:31:20 +03:00
parent 72999092bf
commit f20771a2c3
5 changed files with 6 additions and 11 deletions

View File

@ -136,7 +136,7 @@ const ProductView: FC<Props> = ({ product }) => {
))}
<div className="pb-14 break-words w-full max-w-xl">
<Text html={product.description} />
<Text html={product.descriptionHtml ?? product.description} />
</div>
</section>
<div>

View File

@ -165,6 +165,7 @@ interface Entity {
export interface Product extends Entity {
name: string
description: string
descriptionHtml?: string
slug?: string
path?: string
images: ProductImage[]

View File

@ -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=
```

View File

@ -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),

View File

@ -10,6 +10,7 @@ edges {
vendor
handle
description
descriptionHtml
availableForSale
priceRange {
minVariantPrice {