From 68979e9c57eeb667402d7cdaa544fb3287e61988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Thu, 18 Jun 2020 11:39:25 +0300 Subject: [PATCH] create order from adminpanel --- CHANGELOG.md | 3 +++ VERSION | 2 +- src/include/class-wc-retailcrm-base.php | 13 +++++++++++++ src/readme.txt | 3 +++ src/retailcrm.php | 2 +- src/uninstall.php | 2 +- 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e01c0c..2fa45d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2020-06-18 3.6.5 +* Создание заказа из админпанели + ## 2020-06-18 3.6.4 * Передача названия региона / штата / провинции вместо кода diff --git a/VERSION b/VERSION index 0f44168..d15b8b0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.4 +3.6.5 diff --git a/src/include/class-wc-retailcrm-base.php b/src/include/class-wc-retailcrm-base.php index 4cecfa1..d5326fd 100644 --- a/src/include/class-wc-retailcrm-base.php +++ b/src/include/class-wc-retailcrm-base.php @@ -86,6 +86,7 @@ if (!class_exists('WC_Retailcrm_Base')) { add_action('wp_print_scripts', array($this, 'initialize_analytics'), 98); add_action('wp_print_scripts', array($this, 'initialize_daemon_collector'), 99); add_action('wp_print_footer_scripts', array($this, 'send_analytics'), 99); + add_action('woocommerce_new_order', array($this, 'create_order'), 11, 1); if (!$this->get_option('deactivate_update_order') || $this->get_option('deactivate_update_order') == static::NO @@ -271,6 +272,18 @@ if (!class_exists('WC_Retailcrm_Base')) { $this->customers->updateCustomer($customer_id); } + /** + * Create order in retailCRM from admin panel + * + * @param int $order_id + */ + public function create_order($order_id) + { + if (is_admin()) { + $this->retailcrm_process_order($order_id); + } + } + /** * Edit order in retailCRM * @param int $order_id diff --git a/src/readme.txt b/src/readme.txt index 3afba74..7f27758 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -45,6 +45,9 @@ API-ключ должен быть для отдельного магазина 2. В появившихся списках справочников настройте соответствие способов доставки и оплаты, а так же статусов заказов. Отметьте галочку "Выгружать остатки", если хотите выгружать остатки из Retailcrm в магазин (подробнее смотрите в описании). == Changelog == += 3.6.5 = +* Создание заказа из админпанели + = 3.6.4 = * Передача названия региона / штата / провинции вместо кода diff --git a/src/retailcrm.php b/src/retailcrm.php index fbb44b9..28cd90b 100644 --- a/src/retailcrm.php +++ b/src/retailcrm.php @@ -1,6 +1,6 @@