A Woocommerce REST API client

v0.0.3 2023-01-02 11:35 UTC

This package is auto-updated.

Last update: 2024-10-24 14:41:22 UTC


README

Install

composer require shreejalmaharjan-27/wooclient

Usage

Require composer autoload file and load classfiles

use Shreejalmaharjan27\Wooclient\Category;
use Shreejalmaharjan27\Wooclient\Product;
use Shreejalmaharjan27\Wooclient\WooClient;


require __DIR__.'/vendor/autoload.php';

Create WooClient Object (with trailing slash on website address)

$wooclient = new WooClient("ck_xxxxx,"cs_xxxxx","https://wordpress.example.com/");

Create a Product

$product = new Product($wooclient);
$product->create(name: 'Example Product', price: 18.00, image: 'https://example.com/image.jpg');

Create a Product Category

$category = new Category($wooclient);
$category->create(name: 'Example category');