diff --git a/components/cart/actions.ts b/components/cart/actions.ts index f1c660af3..ec74097e9 100644 --- a/components/cart/actions.ts +++ b/components/cart/actions.ts @@ -32,7 +32,8 @@ export const addItem = async (variantId: string | undefined): Promise => { - const cartId = cookies().get('cartId')?.value; + const cartId = '1'; + // const cartId = cookies().get('cartId')?.value; if (!cartId) { return 'Missing cart ID'; @@ -53,7 +54,8 @@ export const updateItemQuantity = async ({ variantId: string; quantity: number; }): Promise => { - const cartId = cookies().get('cartId')?.value; + const cartId = '1'; + // const cartId = cookies().get('cartId')?.value; if (!cartId) { return 'Missing cart ID'; diff --git a/components/cart/index.tsx b/components/cart/index.tsx index 3e250ba93..e1129e84a 100644 --- a/components/cart/index.tsx +++ b/components/cart/index.tsx @@ -3,7 +3,8 @@ import { cookies } from 'next/headers'; import CartModal from './modal'; export default async function Cart() { - const cartId = cookies().get('cartId')?.value; + // const cartId = cookies().get('cartId')?.value; + const cartId = '1'; let cart; if (cartId) { diff --git a/lib/shopify/index.ts b/lib/shopify/index.ts index 0a6eb97b7..95beafe9a 100644 --- a/lib/shopify/index.ts +++ b/lib/shopify/index.ts @@ -2,8 +2,6 @@ import { mockMoney, mockImage, - mockProductOption, - mockProductVariant, mockShopifyProduct, mockCartItem, mockShopifyCart, diff --git a/lib/shopify/mock.js b/lib/shopify/mock.js index 54f7ab8f5..d21cf3e0c 100644 --- a/lib/shopify/mock.js +++ b/lib/shopify/mock.js @@ -13,25 +13,6 @@ export const mockImage = { height: 500 }; -export const mockProductOption = { - id: 'option1', - name: 'Color', - values: ['Red', 'Blue', 'Green'] -}; - -export const mockProductVariant = { - id: 'variant1', - title: 'Red Variant', - availableForSale: true, - selectedOptions: [ - { - name: 'Color', - value: 'Red' - } - ], - price: mockMoney -}; - export const mockShopifyProduct = adventureProducts[0]; // const mockShopifyProductOld = { @@ -60,14 +41,19 @@ export const mockShopifyProduct = adventureProducts[0]; export const mockCartItem = { id: 'item1', quantity: 1, - cost: { totalAmount: mockMoney }, + cost: { + totalAmount: { + amount: '100.00', + currencyCode: 'USD' + } + }, merchandise: { id: 'merchandise1', - title: 'Sample Merchandise', + title: 'WKDN Adventure', selectedOptions: [ { - name: 'Color', - value: 'Red' + name: 'Duration', + value: 'Normal' } ], product: mockShopifyProduct @@ -78,9 +64,18 @@ export const mockShopifyCart = { id: 'cart1', checkoutUrl: 'https://example.com/checkout', cost: { - subtotalAmount: mockMoney, - totalAmount: mockMoney, - totalTaxAmount: mockMoney + subtotalAmount: { + amount: '90.00', + currencyCode: 'USD' + }, + totalAmount: { + amount: '100.00', + currencyCode: 'USD' + }, + totalTaxAmount: { + amount: '10.00', + currencyCode: 'USD' + } }, lines: { edges: [{ node: mockCartItem }] }, totalQuantity: 1