E
E
Evgeny Nikolaev2019-07-05 09:40:29
1C-Bitrix
Evgeny Nikolaev, 2019-07-05 09:40:29

How to get the trade offer property article (CML2_ARTICLE) in bitrix on D7 directly from the $basket object associated with the order?

Hello!
It is required to receive data from the bitrix order on ajax via api. Now it is possible to add an article, now there is the following code:
$order = \Bitrix\Sale\Order::load($arHistory["ID"]);// get order by Id
foreach ($order->getBasket()-> getBasketItems() as $basketItem) {// Loop through the items and TP in the basket
// here I get any information, for example $name = $basketItem->getField('NAME');
// how to directly from $basketItem->get-offer-property("CML2_ARTICLE"); ?
}
Here is a screenshot of how this property looks in infoblock types
5d1ef1dbefcb6168006651.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Savrasov, 2019-07-05
@alcorn

$basketPropertyCollection = $item->getPropertyCollection(); 
$basketPropertyCollection->getPropertyValues();

But for this, this property is initially needed, it must be added to the basket

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question