mirror of
https://github.com/vercel/commerce.git
synced 2025-05-20 08:26:59 +00:00
fix: fix reshape function for new cart
This commit is contained in:
parent
99d93093c7
commit
5bcf6cb5eb
@ -70,15 +70,15 @@ const reshapeCart = (cart: MedusaCart): Cart => {
|
|||||||
const currencyCode = 'EUR';
|
const currencyCode = 'EUR';
|
||||||
const cost = {
|
const cost = {
|
||||||
subtotalAmount: {
|
subtotalAmount: {
|
||||||
amount: (cart.total && cart.tax_total && cart.total - cart.tax_total)?.toString() || '0',
|
amount: (cart?.total && cart?.tax_total && cart.total - cart.tax_total)?.toString() || '0',
|
||||||
currencyCode
|
currencyCode
|
||||||
},
|
},
|
||||||
totalAmount: {
|
totalAmount: {
|
||||||
amount: (cart.tax_total && cart.tax_total.toString()) || '0',
|
amount: (cart?.tax_total && cart?.tax_total.toString()) || '0',
|
||||||
currencyCode
|
currencyCode
|
||||||
},
|
},
|
||||||
totalTaxAmount: {
|
totalTaxAmount: {
|
||||||
amount: (cart.tax_total && cart.tax_total.toString()) || '0',
|
amount: (cart?.tax_total && cart?.tax_total.toString()) || '0',
|
||||||
currencyCode
|
currencyCode
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user