This commit is contained in:
Jieren Chen 2024-09-08 13:28:59 -04:00
parent 95a9377956
commit 4653f74188
No known key found for this signature in database
GPG Key ID: 2FF322D21B5DB10B
5 changed files with 1 additions and 28 deletions

View File

@ -84,7 +84,6 @@ function updateCartTotals(lines: CartItem[]): Pick<Cart, 'totalQuantity' | 'cost
cost: {
subtotalAmount: { amount: totalAmount.toString(), currencyCode },
totalAmount: { amount: totalAmount.toString(), currencyCode },
totalTaxAmount: { amount: '0', currencyCode }
}
};
}
@ -98,7 +97,6 @@ function createEmptyCart(): Cart {
cost: {
subtotalAmount: { amount: '0', currencyCode: 'USD' },
totalAmount: { amount: '0', currencyCode: 'USD' },
totalTaxAmount: { amount: '0', currencyCode: 'USD' }
}
};
}

View File

@ -177,11 +177,7 @@ export default function CartModal() {
<div className="py-4 text-sm text-neutral-500 dark:text-neutral-400">
<div className="mb-3 flex items-center justify-between border-b border-neutral-200 pb-1 dark:border-neutral-700">
<p>Taxes</p>
<Price
className="text-right text-base text-black dark:text-white"
amount={cart.cost.totalTaxAmount.amount}
currencyCode={cart.cost.totalTaxAmount.currencyCode}
/>
<p className="text-right">Calculated at checkout</p>
</div>
<div className="mb-3 flex items-center justify-between border-b border-neutral-200 pb-1 pt-1 dark:border-neutral-700">
<p>Shipping</p>

View File

@ -165,10 +165,6 @@ export const reshapeCart = (cart: FourthwallCart): Cart => {
amount: totalValue.toString(),
currencyCode,
},
totalTaxAmount: {
amount: '0.0',
currencyCode,
}
},
lines: cart.items.map(reshapeCartItem),
// TODO: Stubbed out

View File

@ -13,13 +13,11 @@ import {
getProductsQuery
} from './queries/product';
import {
Cart,
Collection,
Connection,
Image,
Page,
Product,
ShopifyCart,
ShopifyCollection,
ShopifyCollectionOperation,
ShopifyCollectionsOperation,
@ -97,20 +95,6 @@ const removeEdgesAndNodes = <T>(array: Connection<T>): T[] => {
return array.edges.map((edge) => edge?.node);
};
const reshapeCart = (cart: ShopifyCart): Cart => {
if (!cart.cost?.totalTaxAmount) {
cart.cost.totalTaxAmount = {
amount: '0.0',
currencyCode: 'USD'
};
}
return {
...cart,
lines: removeEdgesAndNodes(cart.lines)
};
};
const reshapeCollection = (collection: ShopifyCollection): Collection | undefined => {
if (!collection) {
return undefined;

View File

@ -102,7 +102,6 @@ export type ShopifyCart = {
cost: {
subtotalAmount: Money;
totalAmount: Money;
totalTaxAmount: Money;
};
lines: Connection<CartItem>;
totalQuantity: number;