mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-03 11:43:16 +03:00
fix #97 Fixed error when validating non-crm customers address
This commit is contained in:
parent
520149394e
commit
7fd6ff80a2
@ -1,3 +1,8 @@
|
|||||||
|
## v3.2.5
|
||||||
|
* Исправлена ошибка брошенных корзин для Prestashop версии ниже 1.7.1
|
||||||
|
* Исправлена ошибка при проверке адреса клиента
|
||||||
|
* Исправлена ошибка подключения к базе данных при запуске тестов
|
||||||
|
|
||||||
## v3.2.4
|
## v3.2.4
|
||||||
* Доработана выгрузка Releases архивов в Git Actions
|
* Доработана выгрузка Releases архивов в Git Actions
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ class RetailCRM extends Module
|
|||||||
{
|
{
|
||||||
$this->name = 'retailcrm';
|
$this->name = 'retailcrm';
|
||||||
$this->tab = 'export';
|
$this->tab = 'export';
|
||||||
$this->version = '3.2.4';
|
$this->version = '3.2.5';
|
||||||
$this->author = 'DIGITAL RETAIL TECHNOLOGIES SL';
|
$this->author = 'DIGITAL RETAIL TECHNOLOGIES SL';
|
||||||
$this->displayName = $this->l('retailCRM');
|
$this->displayName = $this->l('retailCRM');
|
||||||
$this->description = $this->l('Integration module for retailCRM');
|
$this->description = $this->l('Integration module for retailCRM');
|
||||||
@ -367,6 +367,10 @@ class RetailCRM extends Module
|
|||||||
/** @var Customer|CustomerCore|null $customer */
|
/** @var Customer|CustomerCore|null $customer */
|
||||||
$customer = isset($params['customer']) ? $params['customer'] : null;
|
$customer = isset($params['customer']) ? $params['customer'] : null;
|
||||||
|
|
||||||
|
if (empty($customer)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** @var Cart|CartCore|null $cart */
|
/** @var Cart|CartCore|null $cart */
|
||||||
$cart = isset($params['cart']) ? $params['cart'] : null;
|
$cart = isset($params['cart']) ? $params['cart'] : null;
|
||||||
|
|
||||||
@ -379,21 +383,16 @@ class RetailCRM extends Module
|
|||||||
/** @var Address|\AddressCore|array $address */
|
/** @var Address|\AddressCore|array $address */
|
||||||
$address = array();
|
$address = array();
|
||||||
|
|
||||||
if (empty($customer)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Necessary part if we don't want to overwrite other phone numbers.
|
|
||||||
if (isset($customerSend['externalId'])) {
|
if (isset($customerSend['externalId'])) {
|
||||||
$customerData = $this->api->customersGet($customerSend['externalId']);
|
$customerData = $this->api->customersGet($customerSend['externalId']);
|
||||||
|
|
||||||
|
// Necessary part if we don't want to overwrite other phone numbers.
|
||||||
if ($customerData instanceof RetailcrmApiResponse
|
if ($customerData instanceof RetailcrmApiResponse
|
||||||
&& $customerData->isSuccessful()
|
&& $customerData->isSuccessful()
|
||||||
&& $customerData->offsetExists('customer')
|
&& $customerData->offsetExists('customer')
|
||||||
) {
|
) {
|
||||||
$customerSend['phones'] = $customerData['customer']['phones'];
|
$customerSend['phones'] = $customerData['customer']['phones'];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Workaround: PrestaShop will return OLD address data, before editing.
|
// Workaround: PrestaShop will return OLD address data, before editing.
|
||||||
// In order to circumvent this we are using post data to fill new address object.
|
// In order to circumvent this we are using post data to fill new address object.
|
||||||
@ -436,6 +435,7 @@ class RetailCRM extends Module
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user