diff --git a/includes/data-stores/abstract-wc-order-item-type-data-store.php b/includes/data-stores/abstract-wc-order-item-type-data-store.php index 747403345e4..1e7105e3ee5 100644 --- a/includes/data-stores/abstract-wc-order-item-type-data-store.php +++ b/includes/data-stores/abstract-wc-order-item-type-data-store.php @@ -59,11 +59,15 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i public function update( &$item ) { global $wpdb; - $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() ) ); + $changes = $item->get_changes(); + + if ( ! empty( $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();