P
P
photosho2018-06-01 17:42:47
1C-Bitrix
photosho, 2018-06-01 17:42:47

How to display the properties of items in the cart?

It is necessary to display the values ​​of several properties for all products on the cart page. At the same time, the list of properties cannot be passed when connecting the "sale.basket.basket" component. How can I do that?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Nikolaev, 2018-06-01
@photosho

This can be done using the API in result_modifer.php .
I won’t tell you specific pieces of code, there are a lot of options here.

B
bx-dev-hamid, 2018-09-04
@bx-dev-hamid

// выводим рисунок и свойство "Для кого" типа Строка
    $arSelect = Array("IBLOCK_ID", "ID", "NAME", "PREVIEW_PICTURE", "DETAIL_PAGE_URL", "PROPERTY_DLYA_KOGO");
    $arFilter = Array("IBLOCK_ID"=>11, "ID"=>$arBasketItemsIds, "ACTIVE"=>"Y");
    $res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
    while($ob = $res->GetNextElement())
    {
       $arFields = $ob->GetFields();
       $arProps = $ob->GetProperties();
       $PREVIEW_PICTURE = CFile::GetPath($arFields["PREVIEW_PICTURE"]);
       echo $arProps["DLYA_KOGO"]["VALUE"];
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question