PHP code example of shreejalmaharjan-27 / wooclient

1. Go to this page and download the library: Download shreejalmaharjan-27/wooclient library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shreejalmaharjan-27 / wooclient example snippets


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



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

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

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