• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/catalogprovider.php
  • Класс: BitrixCatalogProductCatalogProvider
  • Вызов: CatalogProvider::getAvailableQuantityAndPrice
public function getAvailableQuantityAndPrice(array $products)
	{
		$result = new SaleResult();
		$availableQuantityListResult = $this->getAvailableQuantity($products);

		if ($this->isExistsCatalogData($products))
		{
			$items = $products;
		}
		else
		{
			$items = $this->createProductsListWithCatalogData($products);
		}

		$priceDataList = array();

		foreach ($items as $productId => $productData)
		{
			$catalogData = $productData['CATALOG'];

			if (!empty($catalogData['PRICE_LIST']))
			{
				$priceDataList[$productId] = $catalogData['PRICE_LIST'];
			}

		}

		$availableQuantityData = array();

		if ($availableQuantityListResult->isSuccess())
		{
			$availableQuantityList = $availableQuantityListResult->getData();

			if (isset($availableQuantityList[Base::FLAT_AVAILABLE_QUANTITY_LIST]))
			{
				$availableQuantityData = $availableQuantityList[Base::FLAT_AVAILABLE_QUANTITY_LIST];
			}
		}

		$result->setData([
			Base::SUMMMARY_PRODUCT_LIST => [
				Base::FLAT_PRICE_LIST => $priceDataList,
				Base::FLAT_AVAILABLE_QUANTITY_LIST => $availableQuantityData,
			],
		]);

		return $result;
	}