Answer the question
In order to leave comments, you need to log in
How to get the id of all products on 1c bitrix?
Good afternoon!
How to get the id of all products on the site
, I need to put down the id in the articles on the site, for the revenge of the existing article, but I need to pull out the id of all positions, how can this be done?
Answer the question
In order to leave comments, you need to log in
https://dev.1c-bitrix.ru/api_help/iblock/classes/c...
Returns elements of infoblocks by filter
https://dev.1c-bitrix.ru/api_help/catalog/classes/...
Returns elements product catalog (module catalog)
Use case for your specific task:
CModule::IncludeModule('iblock');
$iIblockID = 1; //тут вставить ИД инфоблока
/*Получаем все ИД товара*/
$resIblock = CIBlockElement::GetList(
array('ID' => 'ASC'),
array(
'IBLOCK_ID' => iIblockID
),
false,
false,
array("ID")
);
while($arID = $resIblock->Fetch())
CIBlockElement::SetPropertyValuesEx($arID['ID'], iIblockID , array('ARTICLE' => $arID['ID'])); //присваиваем коду свойству ARTICLE ИД элемента. вместо ARTICLE поставьте свой код свойства
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question