Answer the question
In order to leave comments, you need to log in
How to get all products in JSON format 1C Bitrix?
Good afternoon!
There is an online store on 1C Bitrix
How can I get all the products by some url (for example , https://example.ru/api/products ) in JSON format
Maybe there are some ready-made solutions? (preferably free or inexpensive)
Thank you!
Answer the question
In order to leave comments, you need to log in
1. you create such section.
2. through api you choose what you need
3. the entire array of data in json_encode($data);
Getting records
<?
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","PROPERTY_*");
$arFilter = Array("IBLOCK_ID"=>IntVal($yvalue), "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r($arFields);
$arProps = $ob->GetProperties();
print_r($arProps);
}
?>
json_encode($data)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question