Answer the question
In order to leave comments, you need to log in
How to display a list of pending products for an unregistered user?
Good afternoon! I display the number of selected products by the code from this link https://camouf.ru/blog-note/6076/
Faced a problem with displaying the list of favorite products by this code.
I withdraw through
// Выведем актуальную корзину для текущего пользователя
$arBasketItems = array();
$dbBasketItems = CSaleBasket::GetList(
array(
"NAME" => "ASC",
"ID" => "ASC"
),
array(
"FUSER_ID" => CSaleBasket::GetBasketUserID(),
"LID" => s1,
"ORDER_ID" => "NULL",
"DELAY" => "Y"
),
false,
false,
array("ID",
"CALLBACK_FUNC",
"MODULE",
"PRODUCT_ID",
"QUANTITY",
"DELAY",
"CAN_BUY",
"PRICE",
"WEIGHT")
);
while ($arItems = $dbBasketItems->Fetch())
{
if (strlen($arItems["CALLBACK_FUNC"]) > 0)
{
CSaleBasket::UpdatePrice($arItems["ID"],
$arItems["CODE"],
$arItems["CALLBACK_FUNC"],
$arItems["MODULE"],
$arItems["PRODUCT_ID"],
$arItems["QUANTITY"]);
$arItems = CSaleBasket::GetByID($arItems["ID"]);
}
$arBasketItems[] = $arItems[PRODUCT_ID];
}
?>
<?$APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"gopro",
array(
"IBLOCK_TYPE" => "catalog",
"IBLOCK_ID" => "20",
"ELEMENT_ID" => $arBasketItems,
"SECTION_ID" => "",
"SECTION_CODE" => "",
// остальные настройки компонента
),
false
);?>
Answer the question
In order to leave comments, you need to log in
Are you sure you are adding to favorites for an unauthorized user? See response for ajax request. If you followed the instructions completely, then this is the /local/ajax/wishlist.php file.
You can do so.
<?
if (CSaleBasket::Add($arFields)){
//...
} else {
global $APPLICATION;
echo $APPLICATION->LAST_ERROR;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question