From b4448cfe946dbac5087bfaa0e6a4af70fa878b05 Mon Sep 17 00:00:00 2001 From: dima-uryvskiy Date: Sun, 14 Mar 2021 14:50:15 +0300 Subject: [PATCH] Do not create orders with the auto-draft status --- src/include/class-wc-retailcrm-orders.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/include/class-wc-retailcrm-orders.php b/src/include/class-wc-retailcrm-orders.php index 7929f13..9c5c44a 100644 --- a/src/include/class-wc-retailcrm-orders.php +++ b/src/include/class-wc-retailcrm-orders.php @@ -371,7 +371,11 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) : return; } - if ($update === true) { + if ($order->get_status() == 'auto-draft') { + return; + } + + if ($update === true) { $this->orders->is_new = false; }