• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/catalogprovider.php
  • Класс: BitrixCatalogProductCatalogProvider
  • Вызов: CatalogProvider::calculateQuantityFromStores
static function calculateQuantityFromStores(array $list): ?array
	{
		$result = [];
		$found = false;
		foreach ($list as $basketItemStores)
		{
			if (
				empty($basketItemStores)
				|| !is_array($basketItemStores)
			)
			{
				continue;
			}
			foreach ($basketItemStores as $storeId => $quantity)
			{
				if (!isset($result[$storeId]))
				{
					$result[$storeId] = 0.0;
				}
				$result[$storeId] += (float)$quantity;
				$found = true;
			}
			unset($storeId, $quantity);
		}
		unset($basketItemStores);

		return ($found ? $result : null);
	}