Исправление передачи местоположения в адресе доставки по истории (#253)
* Корректировка передачи местоположения в адресе доставки по истории
This commit is contained in:
parent
134c92199a
commit
60e818e793
@ -1,3 +1,6 @@
|
|||||||
|
## 2021-05-18 v.6.0.4
|
||||||
|
* Исправление передачи местоположения в адресе доставки по истории
|
||||||
|
|
||||||
## 2021-05-13 v.6.0.3
|
## 2021-05-13 v.6.0.3
|
||||||
* Исправление автозагрузки классов
|
* Исправление автозагрузки классов
|
||||||
|
|
||||||
|
@ -716,45 +716,30 @@ class RetailCrmHistory
|
|||||||
}
|
}
|
||||||
} elseif (array_key_exists($key, $order['delivery']['address'])) {
|
} elseif (array_key_exists($key, $order['delivery']['address'])) {
|
||||||
if ($propsKey[$orderProp]['TYPE'] == 'LOCATION') {
|
if ($propsKey[$orderProp]['TYPE'] == 'LOCATION') {
|
||||||
if( $order['delivery']['address']['index'] ) {
|
|
||||||
$location = CSaleLocation::GetByZIP($order['delivery']['address']['index']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$order['delivery']['address'][$key] = trim($order['delivery']['address'][$key]);
|
|
||||||
if (!empty($order['delivery']['address'][$key])) {
|
if (!empty($order['delivery']['address'][$key])) {
|
||||||
$parameters = array();
|
$parameters['filter']['NAME.LANGUAGE_ID'] = 'ru';
|
||||||
|
$parameters['limit'] = 1;
|
||||||
|
$parameters['select'] = array('*');
|
||||||
|
|
||||||
|
// if address have a dot
|
||||||
$loc = explode('.', $order['delivery']['address'][$key]);
|
$loc = explode('.', $order['delivery']['address'][$key]);
|
||||||
if (count($loc) == 1) {
|
if (count($loc) == 1) {
|
||||||
$parameters['filter']['PHRASE'] = RCrmActions::fromJSON(trim($loc[0]));
|
$parameters['filter']['=NAME.NAME'] = RCrmActions::fromJSON(trim($loc[0]));
|
||||||
} elseif (count($loc) == 2) {
|
|
||||||
$parameters['filter']['PHRASE'] = RCrmActions::fromJSON(trim($loc[1]));
|
|
||||||
} else {
|
} else {
|
||||||
RCrmActions::eventLog(
|
$parameters['filter']['=NAME.NAME'] = RCrmActions::fromJSON(trim($loc[1]));
|
||||||
'RetailCrmHistory::orderHistory',
|
|
||||||
'RetailCrmHistory::setProp',
|
|
||||||
sprintf(
|
|
||||||
'Error location. %s not found add in order number = %s',
|
|
||||||
$order['delivery']['address'][$key],
|
|
||||||
$order['number']
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$parameters['filter']['NAME.LANGUAGE_ID'] = 'ru';
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!isset($location)) {
|
|
||||||
$location = Finder::find(
|
$location = Finder::find(
|
||||||
$parameters,
|
$parameters
|
||||||
['USE_INDEX' => false, 'USE_ORM' => false]
|
|
||||||
)->fetch();
|
)->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($location)) {
|
||||||
$somePropValue = $propertyCollection
|
$somePropValue = $propertyCollection
|
||||||
->getItemByOrderPropertyId($propsKey[$orderProp]['ID']);
|
->getItemByOrderPropertyId($propsKey[$orderProp]['ID'])
|
||||||
|
;
|
||||||
|
try {
|
||||||
self::setProp($somePropValue, $location['CODE']);
|
self::setProp($somePropValue, $location['CODE']);
|
||||||
} catch (ArgumentException $argumentException) {
|
} catch (ArgumentException $argumentException) {
|
||||||
RCrmActions::eventLog(
|
RCrmActions::eventLog(
|
||||||
@ -773,8 +758,6 @@ class RetailCrmHistory
|
|||||||
$order['number']
|
$order['number']
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$somePropValue = $propertyCollection
|
$somePropValue = $propertyCollection
|
||||||
|
@ -1 +1 @@
|
|||||||
- Исправление автозагрузки классов
|
- Исправление передачи местоположения в адресе доставки по истории
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$arModuleVersion = [
|
$arModuleVersion = [
|
||||||
'VERSION' => '6.0.3',
|
'VERSION' => '6.0.4',
|
||||||
'VERSION_DATE' => '2022-05-13 14:00:00'
|
'VERSION_DATE' => '2022-05-18 17:00:00'
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user