You appear to be a bot. Output may be restricted
Description
Update a order item in the database.
Usage
Abstract_WC_Order_Item_Type_Data_Store::update( $item );
Parameters
- $item
- ( WC_Order_Item ) required – Order item object.
Returns
void
Source
File name: woocommerce/includes/data-stores/abstract-wc-order-item-type-data-store.php
Lines:
1 to 25 of 25
public function update( &$item ) { global $wpdb; $changes = $item->get_changes(); if ( array_intersect( array( 'name', 'order_id' ), array_keys( $changes ) ) ) { $wpdb->update( $wpdb->prefix . 'woocommerce_order_items', array( 'order_item_name' => $item->get_name(), 'order_item_type' => $item->get_type(), 'order_id' => $item->get_order_id(), ), array( 'order_item_id' => $item->get_id() ) ); } $this->save_item_data( $item ); $item->save_meta_data(); $item->apply_changes(); $this->clear_cache( $item ); do_action( 'woocommerce_update_order_item', $item->get_id(), $item, $item->get_order_id() ); }