Code Monkey home page Code Monkey logo

nuxtjs-woocommerce's Introduction

Codiga Code Grade Codacy Badge CodeFactor Quality Gate Status

Nuxt 3 Ecommerce site with WooCommerce backend

Project screenshot

Table Of Contents (TOC)

Features

  • Nuxt 3
  • Vue 3 and Composition API
  • Tailwind CSS
  • Nuxt Apollo
  • Pinia with pinia-plugin-persistedstate for cart and state management
  • Responsive design
  • Support for simple and variable products
  • Stock quantity on simple and variable products
  • CSS animations and transitions
  • Form handling and validation with Formkit, Vee Validate and Yup
  • Checkout process
  • Animated mobile menu

Installation

  1. Install and activate the following required plugins, in your WordPress plugin directory:
  • woocommerce Ecommerce for WordPress.
  • wp-graphql Exposes GraphQL for WordPress.
  • wp-graphql-woocommerce Adds WooCommerce functionality to a WPGraphQL schema. Currently only confirmed to be working with version 0.62 of this plugin.
  • algolia-woo-indexer Sends WooCommerce products to Algolia. Required for search to work.

Optional plugin:

  • headless-wordpress Disables the frontend so only the backend is accessible.
  • wp-graphql-cors Ensures that CORS works correctly. Remember to add the domain to the store under Extend "Access-Control-Allow-Origin” header

The current release has been tested and is confirmed working with the following plugin versions:

  • WordPress version 6.1.1
  • WooCommerce version 7.1.0
  • WP GraphQL version 1.5.0
  • WooGraphQL version 0.6.2
  1. Make sure WooCommerce has some products already or import some sample products

    The WooCommerce sample products CSV file is available at wp-content/plugins/woocommerce/sample-data/sample_products.csv or Sample products

    Import the products at WP Dashboard > Tools > Import > WooCommerce products(CSV)

  2. Clone or fork the repo and modify .env with the URL to the GraphQL endpoint (or set environment variables in the configuration UI for your deployment solution)

  3. Start the server with npm run dev

  4. Enable COD (Cash On Demand) payment method in WooCommerce

  5. Add a product to the cart

  6. Proceed to checkout

  7. Fill in your details and place the order

Troubleshooting

I am getting a cart undefined error or other GraphQL errors

Check that you are using the 0.6.2 version of the wp-graphql-woocommerce plugin

I encounter a bug with add to cart

Try logging off wp-admin and try again.

The products page isn't loading

Check the attributes of the products. Right now the application requires Size and Color.

TODO

  • Refactor and improve codebase with reusable components

nuxtjs-woocommerce's People

Contributors

codacy-badger avatar code-factor avatar dependabot-preview[bot] avatar dependabot[bot] avatar lgtm-migrator avatar renovate-bot avatar renovate[bot] avatar w3bdesign avatar

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.