Giter VIP home page Giter VIP logo

nextjs-shopware-starter's Introduction

Next.js Shopware Starter

A Next.js 14 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

Prerequisites

Next.js Shopware Starter 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 Shopware Starter. 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 Shopware Starter

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 Shopware Starter 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.

Activate SEO URLs for your Store

If you want to use your Store with SEO URLs you should set this Envoirment variable SHOPWARE_USE_SEO_URLS="true"

Checkout functionality

The template is provided as-is without an integrated checkout. For projects there are two options - redirect to a native checkout, provided by Shopware or implement a headless checkout flow using our API endpoints for preparing and placing orders.

Community

Any questions, issues or feature requests? Feel free to join the community.

Join our Slack ChannelChannel | ๐Ÿ’ฌ Discuss | ๐Ÿ“š Docu | ๐Ÿš€ Demo

nextjs-shopware-starter's People

Contributors

brocksinet avatar cond0r avatar dependabot[bot] avatar dominiksipowicz avatar francam94 avatar goncy avatar greph avatar julianbenegas avatar kibo-kevinwatts avatar leahtard avatar leerob avatar lfades avatar lucleray avatar manovotny avatar marbiano avatar michaelbromley avatar mkucmus avatar okbel avatar oliverheywood451 avatar pacocoursey avatar pfcodes avatar shaffan avatar shuding avatar sokra avatar stephdietz avatar timneutkens avatar tniezg avatar vczb avatar willianjusten avatar zaiste avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nextjs-shopware-starter's Issues

Did not found any category with collection name: Summer-BBQ/Hidden-Category

I installed Shopware and Nextjs commerce projects locally but when I'm visiting the home page I get this error in logs

[useListing][search] Did not found any category with collection name: Summer-BBQ/Hidden-Category
[useListing][search] Did not found any category with collection name: Summer-BBQ/Hidden-Carousel-Category

I added categories Hidden-Category and Hidden-Carousel-Category but it still isn't working

Screenshot 2024-03-14 at 6 31 45โ€ฏPM

BTW the Nextjs app is running in the broswer:

Screenshot 2024-03-14 at 6 34 10โ€ฏPM

Basic test suite (E2E)

Basic test suite:

  • Homepage + Slider is shown
  • Category-Page is shown
  • Simple-Product-Page is shown
  • Variant-Product-Page is shown
  • Add to Cart with Simple-Product is working
  • Add to Cart with Variant-Product is working
  • Pagination on Category-Page is working
  • Sorting and Pagination is working together
  • Footer Links to CMS-Page is working and shown

Should run in a GitHub action on create PR.

Checkout API example

Hello I would like to implement a custom checkout using the headless API.

It would be extremely helpful to have an example implementation.

Is there any plan to add one to this template, or are there any examples that already exist somewhere else?

Thank you in advance :)

TypeError: Cannot read properties of undefined (reading 'reduce')]

Issue Description:
Problem
Encountering a TypeError during the execution of the shopware integration. The error message specifically states: "Cannot read properties of undefined (reading 'reduce')".

running dockware on docker-compose
using admin-api

any idea what's causing this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.