WordPress at Your Fingertips
function is not described

WC_Abstract_Order::remove_order_items() public WC 1.0

Remove all line items (products, coupons, shipping, taxes) from the order.

{} It's a method of the class: WC_Abstract_Order{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->remove_order_items( $type );
$type(string)
Order item type.
Default: null

Code of WC_Abstract_Order::remove_order_items() WC 5.8.0

public function remove_order_items( $type = null ) {
	if ( ! empty( $type ) ) {
		$this->data_store->delete_items( $this, $type );

		$group = $this->type_to_group( $type );

		if ( $group ) {
			unset( $this->items[ $group ] );
		}
	} else {
		$this->data_store->delete_items( $this );
		$this->items = array();
	}
}