@
@
@profyt2017-03-10 13:09:17
1C-Bitrix
@profyt, 2017-03-10 13:09:17

How to get the properties of product offers?

Good afternoon, I don't understand a little how to get the properties of trade offers using the CCatalogSKU::getOffersList method. Yes, I understand that there is documentation, but the cat wept for information there. I have a product with sales offers that have "height" and "width" properties, how can I get an array with the values ​​of the properties of sales offers for this product? It is assumed that we receive information from the product card, there is a product ID and its other properties....

$arSKU = CCatalogSKU::getOffersList($arResult[ID], 0, array('ACTIVE' => 'Y'), array('NAME'), array('HEIGHT', 'WIDTH'));

There is this code, but in the array I get only the name and id of the offer....
array(1) => 
 [96] =>
     array(160) => 
     [208] =>
         array(3) => 
         [ID] =>
             integer(208)
         [IBLOCK_ID] =>
             integer(8)
         [PROPERTIES] =>
             array(0) => 
     [209] =>
         array(3) => 
         [ID] =>
             integer(209)
         [IBLOCK_ID] =>
             integer(8)
         [PROPERTIES] =>
             array(0) =>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2017-03-10
_

Do you know ID? Forward https://dev.1c-bitrix.ru/api_help/iblock/classes/c... via result_modifier

E
Ekaterina Goncharuk, 2017-05-16
@LisaKatrin

In the last propertyFilter array, you need to write an array with the "CODE" key, that is, you get:
$arSKU = CCatalogSKU::getOffersList($arResult[ID], 0, array('ACTIVE' => 'Y'), array('NAME' ), array("CODE"=>array('HEIGHT', 'WIDTH')));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question