parent
fb4ed685df
commit
ee944b1846
1 changed files with 10 additions and 3 deletions
|
@ -274,7 +274,7 @@ class RetailCrmHistory
|
|||
$matchedCustomUserFields = array_flip($matchedCustomUserFields);
|
||||
|
||||
$matchedCustomOrderFields = RetailcrmConfigProvider::getMatchedOrderProps() ?? [];
|
||||
$matchedCustomOrderFields = array_flip($matchedCustomUserFields);
|
||||
$matchedCustomOrderFields = array_flip($matchedCustomOrderFields);
|
||||
|
||||
self::$CUSTOM_FIELDS_IS_ACTIVE = RetailcrmConfigProvider::getCustomFieldsStatus();
|
||||
|
||||
|
@ -1244,9 +1244,16 @@ class RetailCrmHistory
|
|||
foreach ($order['customFields'] as $code => $value) {
|
||||
if (isset($matchedCustomOrderFields[$code])) {
|
||||
$masIdentifier = explode('#', $matchedCustomOrderFields[$code], 2);
|
||||
$property = $propertyCollection->getItemById($masIdentifier[0]);
|
||||
$property = $propertyCollection->getItemByOrderPropertyId($masIdentifier[0]);
|
||||
$r = $property->setField('VALUE', $value);
|
||||
|
||||
$property->setValue($value);
|
||||
if (!$r->isSuccess()) {
|
||||
RCrmActions::eventLog(
|
||||
'RetailCrmHistory::orderHistory',
|
||||
'CustomOrderPropSave',
|
||||
'Error when saving a property: ' . $masIdentifier[1]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue