mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 22:16:58 +00:00
21 lines
678 B
TypeScript
21 lines
678 B
TypeScript
import { createCart, getCart } from 'lib/shopify';
|
|
import { cookies } from 'next/headers';
|
|
import CartModal from './modal';
|
|
|
|
export default async function Cart() {
|
|
// const cartId = cookies().get('cartId')?.value;
|
|
// let cartIdUpdated = false;
|
|
// let cart;
|
|
// if (cartId) {
|
|
// cart = await getCart(cartId);
|
|
// }
|
|
// // If the `cartId` from the cookie is not set or the cart is empty
|
|
// // (old carts becomes `null` when you checkout), then get a new `cartId`
|
|
// // and re-fetch the cart.
|
|
// if (!cartId || !cart) {
|
|
// cart = await createCart();
|
|
// cartIdUpdated = true;
|
|
// }
|
|
// return <CartModal cart={cart} cartIdUpdated={cartIdUpdated} />;
|
|
}
|