Answer the question
In order to leave comments, you need to log in
Bitrix. Why doesn't getPropertyCollection see all properties?
After updating Bitrix from 18.1 to 20.5, an interesting problem happened:
$order = \Bitrix\Sale\Order::create(SITE_ID, $userID);
$order->setField('STATUS_ID', 'N');
$order->setPersonTypeId(2); // Физическое лицо
$propertyCollection = $order->getPropertyCollection();
$propertyCodeToId = array();
foreach($propertyCollection as $propertyValue){
$propertyCodeToId[$propertyValue->getField('CODE')] = $propertyValue->getField('ORDER_PROPS_ID');
}
echo '<pre>'; print_r($propertyCodeToId); '</pre>';
Answer the question
In order to leave comments, you need to log in
Found a solution.
I don’t know if anyone will have such a problem, but the plan of action is as follows:
In new versions of Bitrix, there may be a glitch: in the list of order properties => property binding => delivery service, the selected elements are not visible. You need to make sure that everything you need is worth it.
Further, binding properties and calling the product must be AFTER adding the shipment and $payment->setField('SUM', $order->getPrice()); (when this method is applied, all related objects will be rebuilt).
After these actions, all properties became available again.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question