WC_Order_Item_Data_Store::update_order_item()publicWC 3.0.0

Update an order item.

Method of the class: WC_Order_Item_Data_Store{}

No Hooks.

Return

true|false.

Usage

$WC_Order_Item_Data_Store = new WC_Order_Item_Data_Store();
$WC_Order_Item_Data_Store->update_order_item( $item_id, $item );
$item_id(int) (required)
Item ID.
$item(array) (required)
order_item_name or order_item_type.

Changelog

Since 3.0.0 Introduced.

WC_Order_Item_Data_Store::update_order_item() code WC 9.4.2

public function update_order_item( $item_id, $item ) {
	global $wpdb;
	$updated = $wpdb->update( $wpdb->prefix . 'woocommerce_order_items', $item, array( 'order_item_id' => $item_id ) );
	$this->clear_caches( $item_id, null );
	return $updated;
}