V
V
Vladislav Dvoryaninov2019-08-22 11:36:43
1C-Bitrix
Vladislav Dvoryaninov, 2019-08-22 11:36:43

What API can be used to get the ADD_URL of an infoblock element?

I can't find how to get ADD_URL via GetList.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mills, 2019-08-22
@mills

I'll show you with an example, hopefully what you're looking for:

<?foreach ($arResult['PROPERTIES']['PRODUCT']['VALUE'] as $product_item):?>
                                    <?
                                     $obElement = CIBlockElement::GetByID($product_item);
                                     if($arEl = $obElement->GetNext()) {
                                        if ($arEl["ID"]){
                                        ?>
                                        <div class="col-md-6">
                                            <a class="prod-name" href="<?=$arEl['DETAIL_PAGE_URL']?>" title="Подробнее - <?=$arEl['NAME'];?>">
                                  <div class="prod-image" style="background-image: url(<?=CFile::GetPath($arEl['DETAIL_PICTURE']);?>)"></div>
                                     <?=$arEl['NAME'];?>
                                            </a>
                              </div>
                                        <?
                                    }
                                }
                                    ?>
                    <?endforeach;?>

Y
Yaroslav Alexandrov, 2019-08-22
@alexyarik

There is [ADD_URL] in catalog.element, for example in arResult['OFFERS'] array, there is no need to look it up via API

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question