update_status()
18th January 2021
0 Comments
Framework / CMS
WooCommerce [Version: Since 2.2.0]
Syntax
Typical Usage
Updates the status of a WooCommerce order.
Accepted Parameters
- new_status (string) (Required): The new status.
- note (string) (Optional): An optional note.
- manual (boolean) (Optional): Whether or not this is a manual order status change.
Return Value(s)
Returns true on success.Notes
new_status does not require an internal wc- prefix.
Examples of update_status()
Example 1
$user_id
);
$new_order = wc_create_order($args);
$new_order->update_status('pending', 'Order is saved and pending payment.', true);
Used In Projects
Was This Helpful?
If this post has helped you, please let me know. Your feedback will be highly appreciated and will help me build better content.