17 Loader::includeModule(
'iblock');
18 Loader::includeModule(
'catalog');
21 $row = \Bitrix\Catalog\CatalogIblockTable::getList([
22 'select' => [
'IBLOCK_ID'],
23 'filter' => [
'=IBLOCK.ACTIVE'=>
'Y']
25 while ($res = $row->fetch())
26 $iblockIds[] = $res[
'IBLOCK_ID'];
29 if (empty($iblockIds))
35 $r = \CIBlockElement::GetList(array(),
36 array(
"=XML_ID" => $code,
"ACTIVE" =>
"Y",
"CHECK_PERMISSIONS" =>
"Y",
"IBLOCK_ID"=>$iblockIds),
39 array(
"ID",
"IBLOCK_ID",
"XML_ID",
"NAME",
"DETAIL_PAGE_URL")
41 if($ar = $r->GetNext())
44 $product = \CCatalogProduct::GetByID($ar[
"ID"]);
46 $result[
"WEIGHT"] = $product[
"WEIGHT"];
47 $result[
"CATALOG_GROUP_NAME"] = $product[
"CATALOG_GROUP_NAME"];
49 $productIBlock = static::getIBlockProduct($ar[
"IBLOCK_ID"]);
50 $result[
"IBLOCK_XML_ID"] = $productIBlock[$ar[
"IBLOCK_ID"]][
"XML_ID"];