/*<< marat 03.09.10
if(isset($_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID]))
{
$num_products = $_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID];
}
else
{ */
if(!CModule::IncludeModule("sale")){
ShowError(GetMessage("SALE_MODULE_NOT_INSTALL"));
return;
}
$fUserID = CSaleBasket::GetBasketUserID(True);
$fUserID = IntVal($fUserID);
$num_products = 0;
if ($fUserID > 0){
$cart_items = CSaleBasket::GetList(
array(),
array('FUSER_ID' => $fUserID, 'LID' => SITE_ID, 'ORDER_ID' => 'NULL', 'CAN_BUY' => 'Y', 'DELAY' => 'N'),
array('SUM' => 'QUANTITY'),
false,
array('ID', 'QUANTITY')
);
$cart_items_array = $cart_items->Fetch();
$num_products = intval($cart_items_array['QUANTITY']);
}
$_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID] = $num_products;
//}
//<< marat 03.09.10
|