use woocommerce rest api for accessing all stores on multisite
-
‘ve start to use woo rest api to get info on orders and so far everything is good, i have woocommerce on a multisite so there is an installation of woo on each site, i got all order from one site by using https://www.cloudways.com/blog/custom-dashboard-using-woocommerce-php-rest-api/ which is a php libray all good, bellow is the authentication. how can i add more sites and get the results under the same table.
how can i make $woocommerce = new Client be equal to all sites, so whatever info i fetch it comes from all sites
<?php $woocommerce = new Client( 'https://example.com', // Your store URL 'consumer_key', // Your consumer key 'consumer_secret', // Your consumer secret [ 'wp_api' => true, // Enable the WP REST API integration 'version' => 'wc/v3' // WooCommerce WP REST API version ] ); ?>
i believe they must be like an array or something to get all sites in 1, but i don’t know how to
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘use woocommerce rest api for accessing all stores on multisite’ is closed to new replies.