• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/basketcomponenthelper.php
  • Класс: BitrixSaleBasketComponentHelper
  • Вызов: BasketComponentHelper::getFUserBasketQuantity
static function getFUserBasketQuantity($fuserId, $siteId = null)
{
	if ($fuserId === null)
	{
		return 0;
	}
	if ($siteId === null)
	{
		$siteId = SITE_ID;
	}

	$quantity = null;
	if (!empty($_SESSION['SALE_USER_BASKET_QUANTITY'][$siteId]) && is_array($_SESSION['SALE_USER_BASKET_QUANTITY'][$siteId])
		&& array_key_exists($fuserId, $_SESSION['SALE_USER_BASKET_QUANTITY'][$siteId]))
	{
		$quantity = $_SESSION['SALE_USER_BASKET_QUANTITY'][$siteId][$fuserId];
	}

	if ($quantity === null)
	{
		static::updateFUserBasketQuantity($fuserId, $siteId);
		$quantity = $_SESSION['SALE_USER_BASKET_QUANTITY'][$siteId][$fuserId];
	}

	return $quantity;
}