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">
|
<div className="pb-14 break-words w-full max-w-xl">
|
||||||
<Text html={product.description} />
|
<Text html={product.descriptionHtml ?? product.description} />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<div>
|
<div>
|
||||||
|
@ -165,6 +165,7 @@ interface Entity {
|
|||||||
export interface Product extends Entity {
|
export interface Product extends Entity {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
|
descriptionHtml?: string
|
||||||
slug?: string
|
slug?: string
|
||||||
path?: string
|
path?: string
|
||||||
images: ProductImage[]
|
images: ProductImage[]
|
||||||
|
@ -24,18 +24,9 @@ Collection of hooks and data fetching functions to integrate Shopify in a React
|
|||||||
|
|
||||||
## Getting Started
|
## 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_STORE_DOMAIN=
|
||||||
NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=
|
NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=
|
||||||
```
|
```
|
||||||
|
@ -93,6 +93,7 @@ export function normalizeProduct(productNode: ShopifyProduct): Product {
|
|||||||
images,
|
images,
|
||||||
variants,
|
variants,
|
||||||
description,
|
description,
|
||||||
|
descriptionHtml,
|
||||||
handle,
|
handle,
|
||||||
priceRange,
|
priceRange,
|
||||||
options,
|
options,
|
||||||
@ -104,6 +105,7 @@ export function normalizeProduct(productNode: ShopifyProduct): Product {
|
|||||||
name,
|
name,
|
||||||
vendor,
|
vendor,
|
||||||
description,
|
description,
|
||||||
|
descriptionHtml,
|
||||||
path: `/${handle}`,
|
path: `/${handle}`,
|
||||||
slug: handle?.replace(/^\/+|\/+$/g, ''),
|
slug: handle?.replace(/^\/+|\/+$/g, ''),
|
||||||
price: money(priceRange?.minVariantPrice),
|
price: money(priceRange?.minVariantPrice),
|
||||||
|
@ -10,6 +10,7 @@ edges {
|
|||||||
vendor
|
vendor
|
||||||
handle
|
handle
|
||||||
description
|
description
|
||||||
|
descriptionHtml
|
||||||
availableForSale
|
availableForSale
|
||||||
priceRange {
|
priceRange {
|
||||||
minVariantPrice {
|
minVariantPrice {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user