Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions islands/Cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function CartInner(props: { cart: CartData | undefined }) {
<div class="flex justify-between text-base font-medium text-gray-900">
<h3>{line.merchandise.product.title}</h3>
<p class="ml-4">
{formatCurrency(line.estimatedCost.totalAmount)}
{formatCurrency(line.cost.totalAmount)}
</p>
</div>
<p class="mt-1 text-sm text-gray-500">
Expand Down Expand Up @@ -171,7 +171,7 @@ function CartInner(props: { cart: CartData | undefined }) {
<div class="border-t border-gray-200 py-6 px-4 sm:px-6">
<div class="flex justify-between text-lg font-medium">
<p>Subtotal</p>
<p>{formatCurrency(props.cart.estimatedCost.totalAmount)}</p>
<p>{formatCurrency(props.cart.cost.totalAmount)}</p>
</div>
<p class="mt-0.5 text-sm text-gray-500">
Shipping and taxes calculated at checkout.
Expand Down
2 changes: 1 addition & 1 deletion islands/ProductDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function ProductDetails({ product }: { product: Product }) {
</h3>
</hgroup>
<div class="bg-[#E8E7E5] rounded-full px-6 py-2 text-lg text-gray-900 font-bold">
{formatCurrency(variant.priceV2)}
{formatCurrency(variant.price)}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion routes/products/[product].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const q = `query ($product: String!) {
id
title
availableForSale
priceV2 {
price {
amount
currencyCode
}
Expand Down
8 changes: 4 additions & 4 deletions utils/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export interface CartData {
title: string;
image: Image;
};
estimatedCost: {
cost: {
totalAmount: Money;
};
}[];
};
checkoutUrl: string;
estimatedCost: {
cost: {
totalAmount: Money;
};
}
Expand All @@ -43,7 +43,7 @@ const CART_QUERY = `{
}
}
}
estimatedCost {
cost {
totalAmount {
amount
currencyCode
Expand All @@ -52,7 +52,7 @@ const CART_QUERY = `{
}
}
checkoutUrl
estimatedCost {
cost {
totalAmount {
amount
currencyCode
Expand Down
2 changes: 1 addition & 1 deletion utils/shopify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function graphql<T>(
query: string,
variables: Record<string, unknown> = {},
): Promise<T> {
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",
Expand Down
2 changes: 1 addition & 1 deletion utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface Product {

export interface ProductVariant {
id: string;
priceV2: Money;
price: Money;
title: string;
availableForSale: boolean;
}