15 1 0 4000 1 https://codeblock.co.za 300 true 0

update_status()

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);

Was This Helpful?

Previous Post
calculate_totals()
Next Post
save()

0 Comments

Leave a Reply