vendredi 27 février 2015

Woocommerce rest api no order returned

i have download the class-wc-api-client.php and create my own php file for getting woocommerce orders data like this:



<?php

require_once "class-wc-api-client.php";

$consumer_key = 'ck_090820a4cf77re32737fe80005yyy643';
$consumer_secret = 'cs_38753tr76y3isjr863gerrc6fdabae17e';
$store_url = 'http://ift.tt/1wuESp7';

// Initialize the class
$wc_api = new WC_API_Client( $consumer_key, $consumer_secret, $store_url );

// Get all orders
$orders = $wc_api->get_orders();
// Output the order object retrieved from the API
print_r( $orders );
?>


But this script return 1, a blank $orders (in my ecommerce there are 2 orders in status completed)


i have create in my website root folder named "/wc-api/v1" and placed here my two php files.


Someone can help me?


thanks in advance


Aucun commentaire:

Enregistrer un commentaire