I have my main domain website with woocommerce products in one wordpress account(lets say WPAcc1) and my sub-domain(which is a blog) in another wordpress account(WPAcc2).

However, to access the woocommerce products that are present in WPAcc1 in WPAcc2, I'm just replicating the product here in WPAcc2 as well.

I've tried accessing the product through Woocommerce API. But, failed to retrieve the details. Is there any better way for that? or Can someone provide me insight on how can I use Woocommerce API to retrieve products from WPAcc1 to WPAcc2 in json format?

  • Is this a multisite install??? – Marko Jezernik Feb 1 '17 at 12:50
  • no..the wp accounts used for my main website and subdomain websites are different – Sudheer DV Feb 1 '17 at 13:53

There's two ways. Firstly you can use XML feed from WP-Site1 on WP-Site2. thought this is a simple method and there's a builtin plugins out there in WP Plugin Directory. but if you are looking for more advanced and robust way (like data in json ) you can play with woocommerce REST API. here are some helpful links to get started with RESTful API in woocommerce. Woocommerce REST API Documentation & WC REST API

| improve this answer | |
  • Hi Rehman..i've been trying to implement WC Rest API...But i'm unable to figure out how to install composer of automattic/woocommerce in WP..can you please help me on that? – Sudheer DV Feb 1 '17 at 13:57
  • Got it resolved..thanks for the help Rehman...could retrieve the json object of the products by sending curl to wp_remote_get() instead of using php library – Sudheer DV Feb 2 '17 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.