Answer the question
In order to leave comments, you need to log in
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
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.
// выводим рисунок и свойство "Для кого" типа Строка
$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 questionAsk a Question
731 491 924 answers to any question