From 65ee374c94ccbc3ed4fa5dea5a8e41d0ce36759d Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 25 Mar 2019 18:09:15 +0300 Subject: [PATCH 1/2] v3.5.0 add functional and translations --- .gitignore | 1 + CHANGELOG.md | 5 +++++ VERSION | 2 +- resources/pot/retailcrm-es_ES.pot | 20 +++++++++++++++++- resources/pot/retailcrm-ru_RU.pot | 20 +++++++++++++++++- .../class-wc-retailcrm-abstracts-settings.php | 12 +++++------ src/languages/retailcrm-es_ES.mo | Bin 5655 -> 6248 bytes src/languages/retailcrm-ru_RU.mo | Bin 7000 -> 7708 bytes src/readme.txt | 5 +++++ src/retailcrm.php | 2 +- src/uninstall.php | 2 +- 11 files changed, 58 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 6a4befe..5b40963 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /nbproject/ /vendor/ +.idea/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 1564cee..71bcdf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2019-03-06 3.5.0 +* Добавлена настройка деактивации выгрузки изменений заказа в retailCRM +* Добавлена настройка активации выгрузки SKU в xmlId и связь товаров по полю xmlId +* Добавлена настройка передачи номера заказа в retailCRM + ## 2019-03-06 3.4.5 * Исправлен баг с добавлением скидки при уменьшении количества товара * Перенесена инициализация формы настроек после инициализации всех плагинов diff --git a/VERSION b/VERSION index 4f5e697..1545d96 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.4.5 +3.5.0 diff --git a/resources/pot/retailcrm-es_ES.pot b/resources/pot/retailcrm-es_ES.pot index c99cb16..d8b64b9 100644 --- a/resources/pot/retailcrm-es_ES.pot +++ b/resources/pot/retailcrm-es_ES.pot @@ -200,4 +200,22 @@ msgid "Enable this setting for activate Daemon Collector on site" msgstr "Active esta configuración para activar Daemon Collector en la página web" msgid "Site key" -msgstr "Clave de la página web" \ No newline at end of file +msgstr "Clave de la página web" + +msgid "Enable data editing in retailCRM" +msgstr "Activar edición de datos en retailCRM" + +msgid "Data updating in retailCRM" +msgstr "Actualización de datos en retailCRM" + +msgid "Activate the binding via sku (xml)" +msgstr "Activar conexión por sku (xmlId)" + +msgid "Stock synchronization and link between products" +msgstr "Sincronización de stock y conexión de productos" + +msgid "Enable transferring the number to retailCRM" +msgstr "Activar la transferencia de números en retailCRM" + +msgid "Transferring the order number" +msgstr "Transferencia de un número de pedido" \ No newline at end of file diff --git a/resources/pot/retailcrm-ru_RU.pot b/resources/pot/retailcrm-ru_RU.pot index 3690109..5da055c 100644 --- a/resources/pot/retailcrm-ru_RU.pot +++ b/resources/pot/retailcrm-ru_RU.pot @@ -209,4 +209,22 @@ msgid "Enable this setting for activate Daemon Collector on site" msgstr "Активируйте эту настройку для активации Daemon Collector на сайте" msgid "Site key" -msgstr "Ключ сайта" \ No newline at end of file +msgstr "Ключ сайта" + +msgid "Enable data editing in retailCRM" +msgstr "Активировать редактирование данных в retailCRM" + +msgid "Data updating in retailCRM" +msgstr "Обновление данных в retailCRM" + +msgid "Activate the binding via sku (xml)" +msgstr "Активировать связь по sku(xmlId)" + +msgid "Stock synchronization and link between products" +msgstr "Синхронизация остатков и связь товаров" + +msgid "Enable transferring the number to retailCRM" +msgstr "Активировать передачу номера в retailCRM" + +msgid "Transferring the order number" +msgstr "Передача номера заказа" \ No newline at end of file diff --git a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php index 3436f53..9737e0a 100644 --- a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php +++ b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php @@ -459,22 +459,22 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration ); $this->form_fields['deactivate_update_order'] = array( - 'label' => __('Активировать редактирование данных в retailCRM', 'retailcrm'), - 'title' => __('Обновление данных в retailCRM', 'retailcrm'), + 'label' => __('Enable data editing in retailCRM', 'retailcrm'), + 'title' => __('Data updating in retailCRM', 'retailcrm'), 'class' => 'checkbox', 'type' => 'checkbox' ); $this->form_fields['bind_by_sku'] = array( - 'label' => __('Активировать связь по sku(xmlId)', 'retailcrm'), - 'title' => __('Синхронизация остатков и связь товаров', 'retailcrm'), + 'label' => __('Activate the binding via sku (xml)', 'retailcrm'), + 'title' => __('Stock synchronization and link between products', 'retailcrm'), 'class' => 'checkbox', 'type' => 'checkbox' ); $this->form_fields['update_number'] = array( - 'label' => __('Активировать передачу номера в retailCRM', 'retailcrm'), - 'title' => __('Передача номера заказа', 'retailcrm'), + 'label' => __('Enable transferring the number to retailCRM', 'retailcrm'), + 'title' => __('Transferring the order number', 'retailcrm'), 'class' => 'checkbox', 'type' => 'checkbox' ); diff --git a/src/languages/retailcrm-es_ES.mo b/src/languages/retailcrm-es_ES.mo index fa24d2750a84ca647dbbc3b667350e8608538444..6eb92d7d6f430d62d9dd80333ed3943b4342e6b5 100644 GIT binary patch delta 2078 zcmaLXO>7ip9LMpe?6x3aD=n=Btvpod3zU~?g(8BMwkCxjf&}y+cDg&*wcD9ycD65~ zS&az?lP1bWIY>Nssv3>So)n{@O$^?R1YZw&z=Ht~5=l(-`x z|1&+?b!B_ur~2euhB8RKmpZV-7zeXSE|hE4#w^7@a5>(1Gya8Jal^9m0-i!` zU>tYj>-YqIg<44C9md>=ZCHmrxRUwJK>Xk^-pvmVYTy~%f^(=BzeNr7YkdDF_Hdsd zEcMuntMLG;|1he*7yn+sA@0wh7WxA&V}5gkhC;N2c(Pd29J?Mh&?el5y|@8KQ45>J zc07;A@fYmF-Q=eQUq-TN-a&pc@1hp;0TN_$9t%x0=4mKrm(k+i*o!U9u9O@@Ezm{v zKZRX*1_^@s62mHEzD8a(dxACxhWboDMy2QqGM7n`X!T!OxU2RTL40Q3Gq&T9}H?fQllbFGL&L zLRE?$q;976Qlsx5qw)Y(MMAqKUD2-ZM-?3!HWr?yN&)nVKb-zf@8t-`Me zC_0s*|Cow$g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4Ze+T5LnAW$vL$F~mOw@B~Skd5LK_ zg~>RFDuL3G1-aoD-|C4|n22Y{Wmf1sf@JHuj@#96?R^ z0TrN&v=!h<)N}5jwQ?j@GmEC(a<`4|wKnM1AoH!`QmA}X?FytehI33lNj z>_M$`1}|VH?_4hqq4tD_SA@AtF{v@hGmr3Dkpr z+PYYl9*~XN6HUmLuvV+x&HUD8)IDk&gIML%Fq2+G=ks9J>it)%rLzzdLbty=*2hMh z>|aw>v=XI}SgZ|Hfoghd%IFH1tzfSCtc-YyIA`Ntd^mu^o~<@tKO=S%Arl8 zRvg5n`ZK~i{KMg0{+fs+e^ Date: Fri, 12 Apr 2019 12:46:04 +0300 Subject: [PATCH 2/2] fix send empty order number --- src/include/order/class-wc-retailcrm-order.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/include/order/class-wc-retailcrm-order.php b/src/include/order/class-wc-retailcrm-order.php index 69d529c..760f880 100644 --- a/src/include/order/class-wc-retailcrm-order.php +++ b/src/include/order/class-wc-retailcrm-order.php @@ -97,11 +97,18 @@ class WC_Retailcrm_Order extends WC_Retailcrm_Abstracts_Data */ protected function set_number($order) { + if ($this->is_new) { + $this->set_data_field('number', $order->get_order_number()); + } + if (isset($this->settings['update_number']) && $this->settings['update_number'] == WC_Retailcrm_Base::YES - && !$this->is_new ) { - $this->set_data_field('number', $order->get_order_number()); + if (!$this->is_new) { + $this->set_data_field('number', $order->get_order_number()); + } + } elseif (!$this->is_new) { + unset($this->data['number']); } }