/WC-API-JS-Client

AngularJS Service/Library to help AngularJS/Ionic Apps interact with WooCommerce Stores.

Primary LanguageJavaScript

WC-API-JS-Client

Add a reference to your index.html file

<script src="wcapi.js"></script>

<script src="services.js"></script>

Do not forget to add your store URL, consumer key and consumer secret to the services.js file.

Inject the WC service in your controllers.

app.controller('myCtrl', function($scope, WC){
  var Woocommerce = WC.WC();
  
  Woocommerce.get('products/categories', function(err, data, res){
    if(err)
      console.log(err);
    console.log(JSON.parse(res));
  })
});

You may need to change the Module Name accordingly in the services.js file.

Works like a Charm in Ionic and AngularJS apps. For more endpoints check the documentation at https://github.com/woothemes/wc-api-node