How to use Woocommerce API to display product from other Woocommerce Website?

Fetch product from third party using Woocommerce API

You need to get consumer and and secret key from the Website whose product need to fetch.

Put this code snippet in functions.php file with required details like consumer key and secret key.

function curl_helper() {
$ch = curl_init();
$c_key = 'CONSUMER KEY';
$c_secret = 'SECRET KEY';
$ch = curl_init('DOMAIN NAME/wc-api/v1/products/?consumer_key='.$c_key.'&consumer_secret='.$c_secret);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($ch);
return json_decode($data);

$products = curl_helper();
echo "

	/*List Product from the Domain you are requesting */
	echo "



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s