Как в заказе указать ФИО и телефон?
И не один не работает.
И вот это тоже пробовал
Не отображается ФИО заказчика при оформление заказа, в чем проблема?
Что я пробовал:
раз
$order->doFinalAction(true);
$propertyCollection = $order->getPropertyCollection();
$phoneProp = $propertyCollection->getPhone();
$phoneProp->setValue($phone);
$nameProp = $propertyCollection->getPayerName();
$nameProp->setValue('dfghj');
2
$propertyCollection = $order->getPropertyCollection();
// телефон
$phoneProp = $propertyCollection->getPhone();
$phoneProp->setValue($phone);
// имя
$nameProp = $propertyCollection->getPayerName();
$nameProp->setValue('Кирилл');
3
$propertyCollection = $order->getPropertyCollection();
function getPropertyByCode($propertyCollection, $code) {
foreach ($propertyCollection as $property)
{
if($property->getField('CODE') == $code)
return $property;
}
}
$emailProperty = getPropertyByCode($propertyCollection, 'EMAIL');
$emailProperty->setValue($email);
$phoneProperty = getPropertyByCode($propertyCollection, 'PHONE');
$phoneProperty->setValue('+79851234567');
$fioProperty = getPropertyByCode($propertyCollection, 'FIO');
$fioProperty->setValue('bvz');
$ADDRESS = getPropertyByCode($propertyCollection, 'ADDRESS');
$ADDRESS->setValue($addr);
4
$propertyCollection = $order->getPropertyCollection();
$propertyCodeToId = array();
foreach($propertyCollection as $propertyValue)
$propertyCodeToId[$propertyValue->getField('CODE')] = $propertyValue->getField('ORDER_PROPS_ID');
$propertyValue=$propertyCollection->getItemByOrderPropertyId($propertyCodeToId['FIO']);
$propertyValue->setValue('Мои имя');
$propertyValue=$propertyCollection->getItemByOrderPropertyId($propertyCodeToId['PHONE']);
$propertyValue->setValue($phone);
$propertyValue=$propertyCollection->getItemByOrderPropertyId($propertyCodeToId['EMAIL']);
$propertyValue->setValue($email);