mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
refactor: use cart.subtotal
This commit is contained in:
parent
10381c0110
commit
575c3a3d0b
@ -70,10 +70,7 @@ const reshapeCart = (cart: MedusaCart): Cart => {
|
||||
const currencyCode = 'EUR';
|
||||
const cost = {
|
||||
subtotalAmount: {
|
||||
amount:
|
||||
(cart?.tax_total && cart?.total && (cart?.total - cart?.tax_total).toString()) ||
|
||||
cart?.total?.toString() ||
|
||||
'0',
|
||||
amount: cart?.subtotal?.toString() || '0',
|
||||
currencyCode: currencyCode
|
||||
},
|
||||
totalAmount: {
|
||||
|
@ -338,6 +338,7 @@ export type MedusaCart = {
|
||||
tax_total?: number;
|
||||
refunded_total?: number;
|
||||
total?: number;
|
||||
subtotal?: number;
|
||||
};
|
||||
|
||||
export type Cart = Partial<MedusaCart> & {
|
||||
|
Loading…
x
Reference in New Issue
Block a user