Skip to content

Commit 2dd590b

Browse files
authored
fix: preventing error with buy together without manipulated discount object
1 parent 09fa483 commit 2dd590b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/routes/ecom/modules/apply-discount.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ ${discountedSkus.map((sku) => `\n${sku}: ${discountPerSku[sku].toFixed(2)}`)}
369369
buyTogether.push({
370370
products: buyTogetherProducts,
371371
discount: {
372-
type: kitDiscount.originalDiscount.type || kitDiscount.discount.type,
373-
value: kitDiscount.originalDiscount.value || kitDiscount.discount.value
372+
type: kitDiscount.originalDiscount?.type || kitDiscount.discount.type,
373+
value: kitDiscount.originalDiscount?.value || kitDiscount.discount.value
374374
}
375375
})
376376
}

0 commit comments

Comments
 (0)