WC_Abstract_Order::remove_item( int $item_id )
Remove item from the order.
Description Description
Parameters Parameters
- $item_id
-
(Required) Item ID to delete.
Return Return
(false|void)
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() ] ); }