diff --git a/app/product/[handle]/page.tsx b/app/product/[handle]/page.tsx index 6c3d4ee91..c3770826d 100644 --- a/app/product/[handle]/page.tsx +++ b/app/product/[handle]/page.tsx @@ -7,8 +7,8 @@ import Footer from "components/layout/footer"; import { Gallery } from "components/product/gallery"; import { ProductDescription } from "components/product/product-description"; import { HIDDEN_PRODUCT_TAG } from "lib/constants"; -import { getProduct, getProductRecommendations } from "lib/shopify"; -import { Image } from "lib/shopify/types"; +import { getProduct, getProductRecommendations } from "lib/commercetools"; +import { Image } from "lib/commercetools/types"; import Link from "next/link"; export const runtime = "edge"; @@ -53,7 +53,7 @@ export async function generateMetadata({ export default async function ProductPage({ params }: { params: { handle: string } }) { const product = await getProduct(params.handle); - + console.log(product); if (!product) return notFound(); const productJsonLd = { diff --git a/app/search/[collection]/opengraph-image.tsx b/app/search/[collection]/opengraph-image.tsx index 09472dcef..33848df51 100644 --- a/app/search/[collection]/opengraph-image.tsx +++ b/app/search/[collection]/opengraph-image.tsx @@ -1,5 +1,5 @@ import OpengraphImage from "components/opengraph-image"; -import { getCollection } from "lib/shopify"; +import { getCollection } from "lib/commercetools"; export const runtime = "edge"; diff --git a/app/search/[collection]/page.tsx b/app/search/[collection]/page.tsx index 1caf3bc58..92fe7021a 100644 --- a/app/search/[collection]/page.tsx +++ b/app/search/[collection]/page.tsx @@ -1,4 +1,4 @@ -import { getCollection, getCollectionProducts } from "lib/shopify"; +import { getCollection, getCollectionProducts } from "lib/commercetools"; import { Metadata } from "next"; import { notFound } from "next/navigation"; diff --git a/app/search/page.tsx b/app/search/page.tsx index 1fe8c9628..6b79da8a8 100644 --- a/app/search/page.tsx +++ b/app/search/page.tsx @@ -1,7 +1,7 @@ import Grid from "components/grid"; import ProductGridItems from "components/layout/product-grid-items"; import { defaultSort, sorting } from "lib/constants"; -import { getProducts } from "lib/shopify"; +import { getProducts } from "lib/commercetools"; export const runtime = "edge"; diff --git a/app/sitemap.ts b/app/sitemap.ts index 01ab20b34..af8f09c8b 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -1,4 +1,5 @@ -import { getCollections, getPages, getProducts } from "lib/shopify"; +import { getCollections, getProducts } from "lib/commercetools"; +import { getPages } from "lib/shopify"; import { validateEnvironmentVariables } from "lib/utils"; import { MetadataRoute } from "next"; diff --git a/components/carousel.tsx b/components/carousel.tsx index 9dc3d40fe..9b191eb8c 100644 --- a/components/carousel.tsx +++ b/components/carousel.tsx @@ -1,4 +1,4 @@ -import { getCollectionProducts } from "lib/shopify"; +import { getCollectionProducts } from "lib/commercetools"; import Link from "next/link"; import { GridTileImage } from "./grid/tile"; diff --git a/components/cart/actions.ts b/components/cart/actions.ts index 187ede5a4..06a968335 100644 --- a/components/cart/actions.ts +++ b/components/cart/actions.ts @@ -1,7 +1,7 @@ "use server"; import { TAGS } from "lib/constants"; -import { addToCart, createCart, getCart, removeFromCart, updateCart } from "lib/shopify"; +import { addToCart, createCart, getCart, removeFromCart, updateCart } from "lib/commercetools"; import { revalidateTag } from "next/cache"; import { cookies } from "next/headers"; diff --git a/components/cart/add-to-cart.tsx b/components/cart/add-to-cart.tsx index 77b5196b3..e5ed612c7 100644 --- a/components/cart/add-to-cart.tsx +++ b/components/cart/add-to-cart.tsx @@ -4,9 +4,10 @@ import { PlusIcon } from "@heroicons/react/24/outline"; import clsx from "clsx"; import { addItem } from "components/cart/actions"; import LoadingDots from "components/loading-dots"; -import { ProductVariant } from "lib/shopify/types"; +import { ProductVariant } from "lib/commercetools/types"; import { useSearchParams } from "next/navigation"; import { useFormState, useFormStatus } from "react-dom"; +import { addToCart } from "lib/commercetools"; function SubmitButton({ availableForSale, @@ -82,7 +83,7 @@ export function AddToCart({ const actionWithVariant = formAction.bind(null, selectedVariantId); return ( -