From 4b42003cd248c3427cf2b287e3cbe437e55cc49e Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Thu, 24 Oct 2024 14:53:57 +0300 Subject: [PATCH] Added check of order status when updating it --- src/include/class-wc-retailcrm-orders.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/class-wc-retailcrm-orders.php b/src/include/class-wc-retailcrm-orders.php index dc38f09..596b640 100644 --- a/src/include/class-wc-retailcrm-orders.php +++ b/src/include/class-wc-retailcrm-orders.php @@ -330,6 +330,11 @@ if (!class_exists('WC_Retailcrm_Orders')) : try { $wcOrder = wc_get_order($orderId); + + if ($wcOrder->get_status() === 'checkout-draft') { + return null; + } + WC_Retailcrm_Logger::info( __METHOD__, 'Update WC_Order ' . $wcOrder->get_id(),