Answers for "ionic react wpapi-node + woocommerce"

0

ionic react wpapi-node + woocommerce

const wpapi = require('wpapi')

let site = new wpapi.discover('https://your-site.com'); // Let wpwpi discover the routes of your site
site.then(function(site){
  site.auth({
  	username: 'woo_rest_username',
    password: 'woo_rest_password'
  })
})

let woocommerce = site.namespace('wc/v3'); // woocommerce endpoint

// Get the latest 10 products
woocommerce.products().perPage(10).embed().then(products => {
  // your code
})
Posted by: Guest on June-18-2021
0

ionic react wpapi-node + woocommerce

const wpapi = require('wpapi')

let site = new wpapi.discover('https://your-site.com'); // Let wpwpi discover the routes of your site
site.then(function(site){
  site.auth({
  	username: 'woo_rest_username',
    password: 'woo_rest_password'
  })
})

let woocommerce = site.namespace('wc/v3'); // woocommerce endpoint

// Get the latest 10 products
woocommerce.products().perPage(10).embed().then(products => {
  // your code
})
Posted by: Guest on June-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language