Giter VIP home page Giter VIP logo

ade-woocart's Introduction

ade-woocart

Description

This plugin helps you to create a cart for your WooCommerce store through API.

Installation

  1. Upload the plugin files to the /wp-content/plugins/ade-woocart directory, or install the plugin through the WordPress plugins screen directly.

  2. Activate the plugin through the 'Plugins' screen in WordPress

  3. Use the Settings->Ade Woocart screen to configure the plugin

Frequently Asked Questions

How to use this plugin?

  1. Add a cart

    • Endpoint: http://yourdomain.com/wp-json/ade-woocart/v1/cart?username=wordpress
    • Method: POST
    • Body:
    {
      "product_id": 248,
      "quantity": 3
    }
    • Response:
    {
      "message": "Item added to cart",
      "status": "success",
      "data": {
        "product_id": 14,
        "quantity": 7,
        "username": "wordpress"
      }
    }
  2. Get cart

    • Endpoint: http://localhost:8888/wordpress/wp-json/ade-woocart/v1/cart?username=wordpress
    • Method: GET
    • Response:
    {
      "username": "wordpress",
      "message": "Cart items",
      "data": "::1",
      "time": "2023-11-28 08:56:43",
      "cart_count": 3,
      "cart_items": [
        {
          "key": "70efdf2ec9b086079795c442636b55fb",
          "product_id": 17,
          "product_name": "Product 3",
          "product_price": "700",
          "product_image": "http://localhost:8888/wordpress/wp-content/uploads/2023/11/c-d-x-PDX_a_82obo-unsplash-scaled-1-150x150.jpg",
          "quantity": 3
        },
        {
          "key": "9bf31c7ff062936a96d3c8bd1f8f2ff3",
          "product_id": 15,
          "product_name": "Product 2",
          "product_price": "1500",
          "product_image": "http://localhost:8888/wordpress/wp-content/uploads/2023/11/eniko-kis-KsLPTsYaqIQ-unsplash-scaled-1-150x150.jpg",
          "quantity": 1
        },
        {
          "key": "aab3238922bcc25a6f606eb525ffdc56",
          "product_id": 14,
          "product_name": "Product 1",
          "product_price": "1000",
          "product_image": "http://localhost:8888/wordpress/wp-content/uploads/2023/11/photo-1523901839036-a3030662f220-150x150.webp",
          "quantity": 1
        }
      ]
    }
  3. Remove from cart

    • Endpoint: http://localhost:8888/wordpress/wp-json/ade-woocart/v1/cart/delete?username=wordpress
    • Method: POST
    • Body:
    {
      "product_id": 17
    }
    • Response:
    {
      "message": "Item removed",
      "status": "success",
      "data": {
        "product_id": 17,
        "username": "wordpress"
      }
    }
  4. Update a cart

    • Endpoint: http://localhost:8888/wordpress/wp-json/ade-woocart/v1/cart/update?username=wordpress
    • Method: POST
    • Body:
    {
      "product_id": 14,
      "quantity": 7
    }
    • Response:
    {
      "message": "Item updated",
      "status": "success",
      "data": {
        "product_id": 14,
        "quantity": 1,
        "username": "wordpress"
      }
    }
  5. Remove all cart items

    • Endpoint: http://localhost:8888/wordpress/wp-json/ade-woocart/v1/cart/delete/all?username=wordpress
    • Method: POST
    • Response:
    {
      "message": "Cart emptied",
      "status": "success",
      "data": {
        "username": "wordpress"
      }
    }

ade-woocart's People

Contributors

adeleyeayodeji avatar

Stargazers

Robert Galeano avatar

Watchers

James Cloos avatar  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.