1
0
mirror of synced 2025-01-18 17:01:41 +03:00

Merge pull request #83 from iyzoer/master

v3.4.2
This commit is contained in:
Alex Lushpai 2019-02-07 11:12:47 +03:00 committed by GitHub
commit 3c0705315d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 24 deletions

View File

@ -1,3 +1,8 @@
## 2019-02-07 3.4.2
* Исправлено изменение типа оплаты на стороне WC
* Добавлен вывод неактивных типов оплаты в настройках
* Удалена генерация внешнего кода клиента
## 2019-01-22 v3.4.1
* Исправлена архивная выгрузка клиентов

View File

@ -1 +1 @@
3.4.1
3.4.2

View File

@ -537,17 +537,15 @@ if (!class_exists('WC_Retailcrm_Base')) {
);
foreach ($wc_payment->payment_gateways() as $payment) {
if (isset($payment->enabled) && $payment->enabled == 'yes') {
$this->form_fields[$payment->id] = array(
'title' => __($payment->method_title, 'woocommerce'),
'description' => __($payment->method_description, 'woocommerce'),
'css' => 'min-width:350px;',
'class' => 'select',
'type' => 'select',
'options' => $payment_option_list,
'desc_tip' => true,
);
}
$this->form_fields[$payment->id] = array(
'title' => __($payment->method_title, 'woocommerce'),
'description' => __($payment->method_description, 'woocommerce'),
'css' => 'min-width:350px;',
'class' => 'select',
'type' => 'select',
'options' => $payment_option_list,
'desc_tip' => true,
);
}
}

View File

@ -136,7 +136,6 @@ if (!class_exists('WC_Retailcrm_Customers')) :
$firstName = $customer->get_first_name();
$data_customer = array(
'createdAt' => $createdAt->date('Y-m-d H:i:s'),
'externalId' => $customer->get_id() > 0 ? $customer->get_id() : uniqid(),
'firstName' => $firstName ? $firstName : $customer->get_username(),
'lastName' => $customer->get_last_name(),
'email' => $customer->get_email(),
@ -149,6 +148,10 @@ if (!class_exists('WC_Retailcrm_Customers')) :
)
);
if ($customer->get_id() > 0) {
$data_customer['externalId'] = $customer->get_id();
}
if ($customer->get_billing_phone()) {
$data_customer['phones'][] = array(
'number' => $customer->get_billing_phone()

View File

@ -411,6 +411,8 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
}
}
$wc_order->save();
return $wc_order->get_id();
}
@ -643,28 +645,32 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
) {
$orders[$change['order']['id']]['items'][$change['item']['id']][$fields['item'][$change['field']]] = $change['newValue'];
}
} else {
if(isset($fields['delivery'][$change['field']]) && $fields['delivery'][$change['field']] == 'service'){
} elseif ($change['field'] == 'payments' && isset($change['payment'])) {
if ($change['newValue'] !== null) {
$orders[$change['order']['id']]['payments'][] = self::newValue($change['payment']);
}
} else {
if (isset($fields['delivery'][$change['field']]) && $fields['delivery'][$change['field']] == 'service') {
$orders[$change['order']['id']]['delivery']['service']['code'] = self::newValue($change['newValue']);
} elseif(isset($fields['delivery'][$change['field']]) && $fields['delivery'][$change['field']]) {
} elseif (isset($fields['delivery'][$change['field']]) && $fields['delivery'][$change['field']]) {
$orders[$change['order']['id']]['delivery'][$fields['delivery'][$change['field']]] = self::newValue($change['newValue']);
} elseif(isset($fields['orderAddress'][$change['field']]) && $fields['orderAddress'][$change['field']]){
} elseif (isset($fields['orderAddress'][$change['field']]) && $fields['orderAddress'][$change['field']]) {
$orders[$change['order']['id']]['delivery']['address'][$fields['orderAddress'][$change['field']]] = $change['newValue'];
} elseif(isset($fields['integrationDelivery'][$change['field']]) && $fields['integrationDelivery'][$change['field']]) {
} elseif (isset($fields['integrationDelivery'][$change['field']]) && $fields['integrationDelivery'][$change['field']]) {
$orders[$change['order']['id']]['delivery']['service'][$fields['integrationDelivery'][$change['field']]] = self::newValue($change['newValue']);
} elseif(isset($fields['customerContragent'][$change['field']]) && $fields['customerContragent'][$change['field']]) {
} elseif (isset($fields['customerContragent'][$change['field']]) && $fields['customerContragent'][$change['field']]) {
$orders[$change['order']['id']][$fields['customerContragent'][$change['field']]] = self::newValue($change['newValue']);
} elseif(strripos($change['field'], 'custom_') !== false) {
} elseif (strripos($change['field'], 'custom_') !== false) {
$orders[$change['order']['id']]['customFields'][str_replace('custom_', '', $change['field'])] = self::newValue($change['newValue']);
} elseif(isset($fields['order'][$change['field']]) && $fields['order'][$change['field']]) {
} elseif (isset($fields['order'][$change['field']]) && $fields['order'][$change['field']]) {
$orders[$change['order']['id']][$fields['order'][$change['field']]] = self::newValue($change['newValue']);
}
if(isset($change['created'])) {
if (isset($change['created'])) {
$orders[$change['order']['id']]['create'] = 1;
}
if(isset($change['deleted'])) {
if (isset($change['deleted'])) {
$orders[$change['order']['id']]['deleted'] = 1;
}
}

View File

@ -45,6 +45,10 @@ API-ключ должен быть для отдельного магазина
2. В появившихся списках справочников настройте соответствие способов доставки и оплаты, а так же статусов заказов. Отметьте галочку "Выгружать остатки", если хотите выгружать остатки из Retailcrm в магазин (подробнее смотрите в описании).
== Changelog ==
= 3.4.2 =
* Исправлено изменение типа оплаты на стороне WC
* Добавлен вывод неактивных типов оплаты в настройках
= 3.4.1 =
* Исправлены некоторые ошибки
@ -166,6 +170,10 @@ API-ключ должен быть для отдельного магазина
* Исправелены ошибки.
== Upgrade Notice ==
= 3.4.2 =
Исправлено изменение типа оплаты на стороне WC
Добавлен вывод неактивных типов оплаты в настройках
= 3.4.0 =
Внедрен Daemon Collector

View File

@ -84,7 +84,6 @@ class WC_Retailcrm_Customers_Test extends WC_Retailcrm_Test_Case_Helper
$customer_send = $retailcrm_customer->getCustomer();
if ($retailcrm) {
$this->assertArrayHasKey('externalId', $customer_send);
$this->assertArrayHasKey('firstName', $customer_send);
$this->assertArrayHasKey('createdAt', $customer_send);
$this->assertArrayHasKey('email', $customer_send);