diff --git a/islands/Cart.tsx b/islands/Cart.tsx index 910eb58..e2efabd 100644 --- a/islands/Cart.tsx +++ b/islands/Cart.tsx @@ -135,7 +135,7 @@ function CartInner(props: { cart: CartData | undefined }) {

{line.merchandise.product.title}

- {formatCurrency(line.estimatedCost.totalAmount)} + {formatCurrency(line.cost.totalAmount)}

@@ -171,7 +171,7 @@ function CartInner(props: { cart: CartData | undefined }) {

Subtotal

-

{formatCurrency(props.cart.estimatedCost.totalAmount)}

+

{formatCurrency(props.cart.cost.totalAmount)}

Shipping and taxes calculated at checkout. diff --git a/islands/ProductDetails.tsx b/islands/ProductDetails.tsx index ed1c07c..2274ea0 100644 --- a/islands/ProductDetails.tsx +++ b/islands/ProductDetails.tsx @@ -64,7 +64,7 @@ export default function ProductDetails({ product }: { product: Product }) {

- {formatCurrency(variant.priceV2)} + {formatCurrency(variant.price)}
diff --git a/routes/products/[product].tsx b/routes/products/[product].tsx index 5ce484d..7ef8bf1 100644 --- a/routes/products/[product].tsx +++ b/routes/products/[product].tsx @@ -18,7 +18,7 @@ const q = `query ($product: String!) { id title availableForSale - priceV2 { + price { amount currencyCode } diff --git a/utils/data.ts b/utils/data.ts index 43d6a1a..de40808 100644 --- a/utils/data.ts +++ b/utils/data.ts @@ -14,13 +14,13 @@ export interface CartData { title: string; image: Image; }; - estimatedCost: { + cost: { totalAmount: Money; }; }[]; }; checkoutUrl: string; - estimatedCost: { + cost: { totalAmount: Money; }; } @@ -43,7 +43,7 @@ const CART_QUERY = `{ } } } - estimatedCost { + cost { totalAmount { amount currencyCode @@ -52,7 +52,7 @@ const CART_QUERY = `{ } } checkoutUrl - estimatedCost { + cost { totalAmount { amount currencyCode diff --git a/utils/shopify.ts b/utils/shopify.ts index f5dc3dd..16ab83f 100644 --- a/utils/shopify.ts +++ b/utils/shopify.ts @@ -11,7 +11,7 @@ export async function graphql( query: string, variables: Record = {}, ): Promise { - const resp = await fetch(`https://${SHOPIFY_SHOP}/api/2022-04/graphql.json`, { + const resp = await fetch(`https://${SHOPIFY_SHOP}/api/2023-10/graphql.json`, { method: "POST", headers: { "Content-Type": "application/json", diff --git a/utils/types.ts b/utils/types.ts index 8e9e063..56bc4e2 100644 --- a/utils/types.ts +++ b/utils/types.ts @@ -34,7 +34,7 @@ export interface Product { export interface ProductVariant { id: string; - priceV2: Money; + price: Money; title: string; availableForSale: boolean; }