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: ''


Top ↑

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.