Comments (9)
I just figured out the issue.. Just incase anyone has this issue, my issue was that a plugin that is no longer installed (WP- Super Cache Manager) was throwing an error into the API return as a comment, so it wouldn't display in the browser unless you viewed the source. I had to go delete the configuration it added into wp-config.php, and that fixed it.
from woocommerce-rest-api-client-library.
@oBigZee can you try with $wc_api->get_orders( array( 'filter[limit]' => 10 ) );
and then post the result here?
from woocommerce-rest-api-client-library.
Just tried it. I still get the following:
object(stdClass)#1801 (1) {
["errors"]=>
array(1) {
[0]=>
object(stdClass)#1726 (2) {
["code"]=>
string(3) "200"
["message"]=>
string(19) "cURL HTTP error 200"
}
}
}
from woocommerce-rest-api-client-library.
I'm not sure what the issue is, since there's enough memory to transfer over the data, the data comes over sorta fine as a string (json_decode returns a syntax error on it though). Interacting with Wordpress directly still works perfectly as well.
from woocommerce-rest-api-client-library.
Post the result as a JSON string, there might be a char causing an issue somewhere.
Sent from my iPhone
On 17 Oct 2014, at 7:12 PM, oBigZee [email protected] wrote:
I'm not sure what the issue is, since there's enough memory to transfer over the data, the data comes over sorta fine as a string (json_decode returns a syntax error on it though). Interacting with Wordpress directly still works perfectly as well.
—
Reply to this email directly or view it on GitHub.
from woocommerce-rest-api-client-library.
{"orders":[{"id":1318,"order_number":"#1318","created_at":"2014-10-18T02:19:00Z","updated_at":"2014-10-18T02:19:53Z","completed_at":"2014-10-18T02:19:53Z","status":"processing","currency":"CAD","total":"0.00","subtotal":"0.00","total_line_items_quantity":0,"total_tax":"0.00","total_shipping":"0.00","cart_tax":"0.00","shipping_tax":"0.00","total_discount":"0.00","cart_discount":"0.00","order_discount":"0.00","shipping_methods":"","payment_details":{"method_id":"paypal","method_title":"PayPal","paid":false},"billing_address":{"first_name":"testName","last_name":"testLname","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":"","email":"[email protected]","phone":""},"shipping_address":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":""},"note":"","customer_ip":"","customer_user_agent":"","customer_id":"0","view_order_url":"http:\/\/test.com\/my-account\/view-order\/1318","line_items":[],"shipping_lines":[],"tax_lines":[],"fee_lines":[],"coupon_lines":[],"customer":{"id":0,"email":"[email protected]","first_name":"testName","last_name":"testLname","billing_address":{"first_name":"testName","last_name":"testLname","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":"","email":"[email protected]","phone":""},"shipping_address":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":""}}}]}
I limited the order returns to just 1. Running var_dump(json_decode()) on this returns "NULL".
from woocommerce-rest-api-client-library.
Hey, I'm still having this issue, any help is much appreciated!
from woocommerce-rest-api-client-library.
Hi,
I'm still having issues with this. I tried the following code:
$wc_api = new WC_API_Client( $consumer_key, $consumer_secret, $store_url );
$wc_api->set_return_as_object(false);
$orders = $wc_api->get_orders(array( 'status' => 'processing,on-hold', 'filter[limit]' => 5 ));
echo "<pre>";
var_dump(json_decode($orders));
switch (json_last_error()) {
case JSON_ERROR_NONE:
echo ' - No errors';
break;
case JSON_ERROR_DEPTH:
echo ' - Maximum stack depth exceeded';
break;
case JSON_ERROR_STATE_MISMATCH:
echo ' - Underflow or the modes mismatch';
break;
case JSON_ERROR_CTRL_CHAR:
echo ' - Unexpected control character found';
break;
case JSON_ERROR_SYNTAX:
echo ' - Syntax error, malformed JSON';
break;
case JSON_ERROR_UTF8:
echo ' - Malformed UTF-8 characters, possibly incorrectly encoded';
break;
default:
echo ' - Unknown error';
break;
}
Outputs this:
NULL
- Syntax error, malformed JSON
from woocommerce-rest-api-client-library.
@kloon I have found this topic by a chance.
$wc_api->get_orders( array( 'filter[limit]' => 10 ) );
is extremely useful an looks totally undocumented anywhere else.
Thank you!
from woocommerce-rest-api-client-library.
Related Issues (20)
- how to insert returened data in sql server?
- Invalid JSON
- exclude category from list all categories
- how to get woocommerce data into android application
- how to pass parameters in services
- uncaught in promise error consumer key is required error.consumerKey is required at new Woocommerce API(localhost:8100/build/vendor.js HOT 2
- Works for Legacy API, but for latest version it gives Invalid Json Returned using example.php file provided with response code 200 HOT 1
- Return 10 porducts HOT 2
- Trying to get list of orders but throws exception
- woocomerce REST-API
- creating custom post & response
- get error "The use statement with non-compound " on example
- uncaught in promise error consumer key is required error.consumerKey is required at new Woocommerce API(localhost:8100/build/vendor.js
- How to get nonce
- getting error while creating product using google drive links for images. HOT 1
- woocommerce plugin
- create custom field for order
- Help me I want rest app
- Help me
- Store timezone info?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woocommerce-rest-api-client-library.