Retrieve a single product and a single category by id. This is my code:
this.WooCommerce = WC({
url: "https://mmarket.ir",
consumerKey: "ck_bd53%###########cfa",
consumerSecret: "cs_b9%$##########2ff4",
wpAPI: true,
version: 'wc/v2',
});
this.WooCommerce.get('orders/5953', function(err, data, res) {
console.log('SINGLE ORDER IS: ',res);
});
this.WooCommerce.get('products/5439', function(error, data , res){
console.log("SINGLE PRODUCT IS: ", res)
});
After executing "npm run browser" or "ionic serve" I get empty result:
home.ts:67 SINGLE PRODUCT IS:
home.ts:62 SINGLE ORDER IS:
I could easily retrieve single product from woocommerce using rest api in past days but it is not possible from 2 days ago!
I use "Allow CORS: Access-Control-Allow-Origin" & "Allow-Control-Allow-Origin:* " chrom extentions.
Any idea?