WC_Abstract_Order::remove_item( int $item_id )

Remove item from the order.


Description Description


Parameters Parameters

$item_id

(Required) Item ID to delete.


Top ↑

Return Return

(false|void)


Top ↑

Source Source

File: includes/abstracts/abstract-wc-order.php

	public function remove_item( $item_id ) {
		$item      = $this->get_item( $item_id, false );
		$items_key = $item ? $this->get_items_key( $item ) : false;

		if ( ! $items_key ) {
			return false;
		}

		// Unset and remove later.
		$this->items_to_delete[] = $item;
		unset( $this->items[ $items_key ][ $item->get_id() ] );
	}


Top ↑

User Contributed Notes User Contributed Notes

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