CModule::IncludeModule('sale');
$arBasketItems = array();
$dbBasketItems = CSaleBasket::GetList(
array(
"NAME" => "ASC",
"ID" => "ASC"
),
array(
"FUSER_ID" => CSaleBasket::GetBasketUserID(),
"LID" => SITE_ID,
"ORDER_ID" => "NULL"
),
false,
false,
array("ID", "CALLBACK_FUNC", "MODULE",
"PRODUCT_ID", "QUANTITY", "DELAY",
"CAN_BUY", "PRICE", "WEIGHT")
);
while ($arItem = $dbBasketItems->Fetch())
{
$arItem = CSaleBasket::GetByID($arItem["ID"]);
$arDiscounts = CCatalogDiscount::GetDiscountByProduct(
$arItem['PRODUCT_ID'],
$USER->GetUserGroupArray(),
"N",
2,
SITE_ID
);
}