wc-api-php: Invalid JSON returned
I would like to list all products, therefore I used the filter[limit] like this
$woocommerce->get('products', array('filter[limit]' => 10000, 'fields' => 'id,title,sku,variations'));
Unfortunately I get PHP-error message saying
Fatal error: Uncaught exception 'Automattic\WooCommerce\HttpClient\HttpClientException' with message 'Invalid JSON returned' in /var/www/html/wcapi/src/WooCommerce/HttpClient/HttpClient.php:303 Stack trace: #0 /var/www/html/wcapi/src/WooCommerce/HttpClient/HttpClient.php(346): Automattic\WooCommerce\HttpClient\HttpClient->lookForErrors(NULL) #1 /var/www/html/wcapi/src/WooCommerce/HttpClient/HttpClient.php(382): Automattic\WooCommerce\HttpClient\HttpClient->processResponse() #2 /var/www/html/wcapi/src/WooCommerce/Client.php(82): Automattic\WooCommerce\HttpClient\HttpClient->request('products', 'GET', Array, Array) #3 /var/www/html/wcapi/wcapi.php(1189): Automattic\WooCommerce\Client->get('products', Array) #4 {main} thrown in /var/www/html/wcapi/src/WooCommerce/HttpClient/HttpClient.php on line 303
Is there a way to list all products?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (6 by maintainers)
Well, when you will change your permalink settings , Plain to Post name, this error will disappear.
so change your site’s permalink setting, dont use default setting