Reputation: 31
When trying to update the order with
$client->orders->update_status($order_id_to_update, $status);
it creates a new order with the exact same information and updates status for both the original and the newly created order. How can I stop this from happening and only have my submitted order_ID changing status?
Upvotes: 2
Views: 8287
Reputation: 198
With Python it's as simple as print(wcapi.put("orders/727", data).json())
, where data is a key-value pair object.
See: http://woocommerce.github.io/woocommerce-rest-api-docs/#orders
Upvotes: 1
Reputation: 2644
Verify that you have give a coherent order_id_to_update and well status ! If you put a int value on $status, you'll have a order who have a know status, so it will not visible in wordpress
Upvotes: 0
Reputation: 11861
$order = new WC_Order($order_id);
$order->update_status('pending');
Try this code snippet
Upvotes: 1