Cart fixes (backend), adjusted header, added footer, mobile formatting updates

This commit is contained in:
augmentedpotato
2026-04-14 05:24:40 -06:00
parent 8e205ebca2
commit 7bddd74a6e
13 changed files with 769 additions and 107 deletions

View File

@@ -10,6 +10,7 @@ import {
apiClearCart,
apiApplyCoupon,
apiCheckout,
apiCancelCheckout,
} from "@/lib/cartApi";
const CartContext = createContext(null);
@@ -133,6 +134,15 @@ export function CartProvider({ children }) {
[token, selectedStoreId]
);
const cancelCheckout = useCallback(
async () => {
if (!token || !selectedStoreId) return;
await apiCancelCheckout(token, selectedStoreId);
await refreshCart();
},
[token, selectedStoreId, refreshCart]
);
const itemCount = cart?.items?.reduce((sum, i) => sum + i.quantity, 0) ?? 0;
return (
@@ -150,6 +160,7 @@ export function CartProvider({ children }) {
clearCart,
applyCoupon,
checkout,
cancelCheckout,
refreshCart,
}}
>