Download the PHP package mac2000/woo-commerce-api-client without Composer
On this page you can find all versions of the php package mac2000/woo-commerce-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mac2000/woo-commerce-api-client
More information about mac2000/woo-commerce-api-client
Files in mac2000/woo-commerce-api-client
Package woo-commerce-api-client
Short Description API client for Wordpress WooCommerce plugin
License MIT
Informations about the package woo-commerce-api-client
WooCommerce API Client
API client for Wordpress WooCommerce plugin.
It was created first of all form importing products into fresh installed store.
API documentation can be found here: http://woothemes.github.io/woocommerce-rest-api-docs/
Installation
This client can be installed using Composer. Add the following to your composer.json:
Usage Examples
Instantiation:
Creating simple product
Notice that if you want product to use predefined attributes you should provide attribute slug.
Create variable product
Retrieve products
Retrie all product ids
Security
Important notice. If you on shared hosting there is possibility that requests without user agent is restricted (In my case I got 404 Not found errors). To avoid this add user agent to your client like this:
Missing API
Unfortunately at moment not all things are implemented in WooCommerce API but there is still a way to manage your store.
Project contains class MissingApiHelper
that implements some missing things via XMLRPC.
For example as you know attributes for product can be two types - taxonomy that can be used in layered navigation and custom post meta.
If you want create product with taxonomy attribute you should create it first.
Here is full example of creating such product:
This code will:
Create categories hierarchy
Create attribute options
Notice: Attributes itself can not be created from outside, so you should create Brand and Color attributes before importing products
Create product with predefined attributes
All versions of woo-commerce-api-client with dependencies
guzzlehttp/oauth-subscriber Version 0.2.*
hieu-le/wordpress-xmlrpc-client Version 2.4.*