2023-08-04 15:26:36 +02:00
2023-08-04 14:45:20 +02:00
2023-07-13 13:21:20 +02:00
2023-08-04 15:26:36 +02:00
2023-08-04 15:03:18 +02:00
2023-08-04 15:03:18 +02:00
2023-04-17 22:00:47 -05:00
2023-04-17 22:00:47 -05:00
2023-08-03 20:24:37 -05:00
2023-04-17 22:00:47 -05:00
2023-07-06 10:42:30 +02:00
2023-08-04 14:43:43 +02:00
2023-08-04 14:43:43 +02:00
2023-07-06 10:42:30 +02:00

Next.js Commerce & Shopware Composable Frontends

A Next.js 13 and App Router-ready ecommerce template featuring:

  • Next.js App Router
  • Optimized for SEO using Next.js's Metadata
  • React Server Components (RSCs) and Suspense
  • Server Actions for mutations
  • Edge Runtime
  • New fetching and caching paradigms
  • Dynamic OG images
  • Styling with Tailwind CSS
  • Automatic light/dark mode based on system settings

Note: Looking for Next.js Commerce v1? View the code, demo, and release notes.

Prerequisites

Next.js + Shopware requires a running Shopware 6 Instance (Installation Guide).

To get started, use this README and the example environment variable comments.

Running locally

You will need to use the environment variables defined in .env.example to run Next.js Commerce. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.

Note: You should not commit your .env file or it will expose secrets that will allow others to control your Shopware store.

  1. Install Vercel CLI: npm i -g vercel
  2. Link local instance with Vercel and GitHub accounts (creates .vercel directory): vercel link
  3. Download your environment variables: vercel env pull
pnpm install
pnpm dev

Your app should now be running on localhost:3000.

How to configure your Shopware store for Next.js Commerce

You can find the SHOPWARE_ACCESS_TOKEN in the Admin at your SalesChannel configuration.

Add Shopware domain to an environment variable

Copy .env.example file to .env and change the environment variables like descibed below.

Create a SHOPWARE_STORE_DOMAIN environment variable and use your Shopware domain as the the value (ie. demo-frontends.shopware.store).

Note: Do not include the https://.

Accessing the Shopware store API

Next.js Commerce utilizes Shopware's store API to create unique customer experiences. The API offers a full range of commerce options making it possible for customers to control products, collections, menus, pages, cart, checkout, and more.

In order to use the Shopware's store API, you need at least one (Storefront) SalesChannel (for speaking URL's) in your Shopware instance.

Once installed, you'll need to create a SHOPWARE_ACCESS_TOKEN environment variable and use the public access token as the value

Note: We using an api Client package that helps you with types, endpoints, params and returns.

Description
clone of nextjs commerce (vercel) for a nice ecommerce site based in js.
Readme 2.6 GiB
Languages
TypeScript 99.2%
CSS 0.7%
JavaScript 0.1%