1
0
Fork 0
mirror of synced 2025-04-11 05:00:55 +00:00
Исправление синхронизации кастомных полей заказа
This commit is contained in:
Ivan Chaplygin 2023-12-05 23:13:12 +03:00
parent fb4ed685df
commit ee944b1846

View file

@ -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]
);
}
}
}
}