diff --git a/src/include/class-wc-retailcrm-base.php b/src/include/class-wc-retailcrm-base.php index 12a5d5e..5f645d6 100644 --- a/src/include/class-wc-retailcrm-base.php +++ b/src/include/class-wc-retailcrm-base.php @@ -145,6 +145,7 @@ if (!class_exists('WC_Retailcrm_Base')) { ) { add_action('woocommerce_update_order', [$this, 'take_update_order'], 11, 1); add_action('shutdown', [$this, 'update_order'], -1); + add_action('woocommerce_saved_order_items', [$this, 'update_order_items'], 10, 1); } if ($this->get_option('abandoned_carts_enabled') === static::YES) { @@ -585,6 +586,11 @@ if (!class_exists('WC_Retailcrm_Base')) { } } + public function update_order_items($orderId) + { + $this->orders->updateOrder($orderId); + } + public function trash_order_action($id) { if ('shop_order' == get_post_type($id)) {