mirror of
https://github.com/vercel/commerce.git
synced 2025-06-18 21:21:21 +00:00
Add product descriptionHtml
This commit is contained in:
parent
72999092bf
commit
f20771a2c3
@ -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>
|
||||
|
@ -165,6 +165,7 @@ interface Entity {
|
||||
export interface Product extends Entity {
|
||||
name: string
|
||||
description: string
|
||||
descriptionHtml?: string
|
||||
slug?: string
|
||||
path?: string
|
||||
images: ProductImage[]
|
||||
|
@ -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=
|
||||
```
|
||||
|
@ -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),
|
||||
|
@ -10,6 +10,7 @@ edges {
|
||||
vendor
|
||||
handle
|
||||
description
|
||||
descriptionHtml
|
||||
availableForSale
|
||||
priceRange {
|
||||
minVariantPrice {
|
||||
|
Loading…
x
Reference in New Issue
Block a user