Warning: This method has been deprecated. Moved to event handler instead.
WC_Abstract_Legacy_Order::cancel_order( string $note = '' )
Cancel the order and restore the cart (before payment).
Description Description
Parameters Parameters
- $note
-
(Optional) (default: '') Optional note to add.
Default value: ''
Source Source
File: includes/legacy/abstract-wc-legacy-order.php
public function cancel_order( $note = '' ) { wc_deprecated_function( 'WC_Order::cancel_order', '3.0', 'WC_Order::update_status' ); WC()->session->set( 'order_awaiting_payment', false ); $this->update_status( 'cancelled', $note ); }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |