mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 22:16:58 +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 currencyCode = 'EUR';
|
||||||
const cost = {
|
const cost = {
|
||||||
subtotalAmount: {
|
subtotalAmount: {
|
||||||
amount:
|
amount: cart?.subtotal?.toString() || '0',
|
||||||
(cart?.tax_total && cart?.total && (cart?.total - cart?.tax_total).toString()) ||
|
|
||||||
cart?.total?.toString() ||
|
|
||||||
'0',
|
|
||||||
currencyCode: currencyCode
|
currencyCode: currencyCode
|
||||||
},
|
},
|
||||||
totalAmount: {
|
totalAmount: {
|
||||||
|
@ -338,6 +338,7 @@ export type MedusaCart = {
|
|||||||
tax_total?: number;
|
tax_total?: number;
|
||||||
refunded_total?: number;
|
refunded_total?: number;
|
||||||
total?: number;
|
total?: number;
|
||||||
|
subtotal?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Cart = Partial<MedusaCart> & {
|
export type Cart = Partial<MedusaCart> & {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user