1
0
mirror of synced 2025-03-20 15:13:56 +03:00

sync more fields in the history

This commit is contained in:
Pavel 2020-06-10 12:13:51 +03:00 committed by GitHub
parent 4a80d07681
commit ef796ebd75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 4 deletions

View File

@ -1,3 +1,6 @@
## 2020-06-10 3.6.3
* Улучшено обновление данных заказа по истории
## 2020-04-13 3.6.2
* Исправлена ошибка, которая приводила к дублированию некоторых клиентов

View File

@ -1 +1 @@
3.6.2
3.6.3

View File

@ -317,6 +317,7 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
* @param array $options
*
* @return bool
* @throws \WC_Data_Exception
*/
protected function orderUpdate($order, $options)
{
@ -330,6 +331,30 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
$wc_order->update_status($options[$order['status']]);
}
if (isset($order['customerComment'])) {
$wc_order->set_customer_note($order['customerComment']);
}
if (isset($order['managerComment']) && !empty($order['managerComment'])) {
$wc_order->add_order_note($order['managerComment'], 0, false);
}
if (isset($order['firstName'])) {
$wc_order->set_shipping_first_name($order['firstName']);
}
if (isset($order['lastName'])) {
$wc_order->set_shipping_last_name($order['lastName']);
}
if (isset($order['phone'])) {
$wc_order->set_billing_phone($order['phone']);
}
if (isset($order['email'])) {
$wc_order->set_billing_email($order['email']);
}
if (array_key_exists('items', $order)) {
foreach ($order['items'] as $key => $item) {
@ -519,7 +544,7 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
$args = array(
'status' => isset($options[$order['status']])
? isset($options[$order['status']])
? $options[$order['status']]
: 'processing',
'customer_id' => isset($order['customer']['externalId'])
? $order['customer']['externalId']

View File

@ -45,6 +45,9 @@ API-ключ должен быть для отдельного магазина
2. В появившихся списках справочников настройте соответствие способов доставки и оплаты, а так же статусов заказов. Отметьте галочку "Выгружать остатки", если хотите выгружать остатки из Retailcrm в магазин (подробнее смотрите в описании).
== Changelog ==
= 3.6.3 =
* Улучшено обновление данных заказа по истории
= 3.6.2 =
* Исправлена ошибка, которая приводила к дублированию некоторых клиентов

View File

@ -1,6 +1,6 @@
<?php
/**
* Version: 3.6.2
* Version: 3.6.3
* WC requires at least: 3.0
* WC tested up to: 3.9.3
* Plugin Name: WooCommerce retailCRM

View File

@ -15,7 +15,7 @@
*
*
* @link https://wordpress.org/plugins/woo-retailcrm/
* @version 3.6.2
* @version 3.6.3
*
* @package RetailCRM
*/