mirror of
https://github.com/vercel/commerce.git
synced 2025-06-18 21:21:21 +00:00
Changes to Shopify
This commit is contained in:
parent
a6cbd3d581
commit
9a57e0281c
@ -98,7 +98,7 @@ export function normalizeProduct(productNode: ShopifyProduct): Product {
|
|||||||
variants: variants ? normalizeProductVariants(variants) : [],
|
variants: variants ? normalizeProductVariants(variants) : [],
|
||||||
options: options
|
options: options
|
||||||
? options
|
? options
|
||||||
.filter((o) => o.name !== 'Title') // By default Shopify adds a 'Title' name when there's only one option. We don't need it.
|
.filter((o) => o.name !== 'Title') // By default Shopify adds a 'Title' name when there's only one option. We don't need it. https://community.shopify.com/c/Shopify-APIs-SDKs/Adding-new-product-variant-is-automatically-adding-quot-Default/td-p/358095
|
||||||
.map((o) => normalizeProductOption(o))
|
.map((o) => normalizeProductOption(o))
|
||||||
: [],
|
: [],
|
||||||
...rest,
|
...rest,
|
||||||
@ -147,7 +147,11 @@ function normalizeLineItem({
|
|||||||
},
|
},
|
||||||
path: '',
|
path: '',
|
||||||
discounts: [],
|
discounts: [],
|
||||||
options: [
|
options:
|
||||||
|
// By default Shopify adds a default variant with default names, we're removing it. https://community.shopify.com/c/Shopify-APIs-SDKs/Adding-new-product-variant-is-automatically-adding-quot-Default/td-p/358095
|
||||||
|
variant?.title == 'Default Title'
|
||||||
|
? []
|
||||||
|
: [
|
||||||
{
|
{
|
||||||
value: variant?.title,
|
value: variant?.title,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user