feat(core-flows,types,utils): make payment optional when cart balance is 0 (#11872)
what: - make payment optional when cart balance is 0
This commit is contained in:
@@ -768,7 +768,7 @@ describe("Total calculation", function () {
|
||||
},
|
||||
],
|
||||
total: 48,
|
||||
subtotal: 60,
|
||||
subtotal: 100,
|
||||
tax_total: 8,
|
||||
discount_total: 22,
|
||||
discount_subtotal: 20,
|
||||
|
||||
@@ -208,8 +208,6 @@ export function decorateCartTotals(
|
||||
taxRate: creditLinesSumTaxRate,
|
||||
})
|
||||
|
||||
subtotal = MathBN.sub(subtotal, creditLinesSubtotal)
|
||||
|
||||
const taxTotal = MathBN.add(itemsTaxTotal, shippingTaxTotal)
|
||||
|
||||
const originalTaxTotal = MathBN.add(
|
||||
@@ -222,7 +220,7 @@ export function decorateCartTotals(
|
||||
|
||||
// TODO: subtract (cart.gift_card_total + cart.gift_card_tax_total)
|
||||
const tempTotal = MathBN.add(subtotal, taxTotal)
|
||||
const total = MathBN.sub(tempTotal, discountSubtotal)
|
||||
const total = MathBN.sub(tempTotal, discountSubtotal, creditLinesTotal)
|
||||
|
||||
const cart = cartLike as any
|
||||
|
||||
|
||||
Reference in New Issue
Block a user