PHP code example of wic / woocommerce-api
1. Go to this page and download the library: Download wic/woocommerce-api 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/ */
wic / woocommerce-api example snippets
use WIC/Client;
$options = array(
'ssl_verify' => false,
);
try {
$client = new Client( 'http://your-store-url.com', $consumer_key, $consumer_secret, $options );
} catch ( ClientException $e ) {
echo $e->getMessage() . PHP_EOL;
echo $e->getCode() . PHP_EOL;
if ( $e instanceof ClientHTTPException ) {
print_r( $e->get_request() );
print_r( $e->get_response() );
}
}