• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/catalogprovider.php
  • Класс: BitrixCatalogProductCatalogProvider
  • Вызов: CatalogProvider::changeSubscribeProductQuantity
static function changeSubscribeProductQuantity(array $products, array $iblockProductMap): array
	{
		$resultList = $products;

		foreach ($iblockProductMap as $iblockData)
		{
			if ($iblockData['SUBSCRIPTION'] != 'Y')
				continue;

			if (empty($iblockData['PRODUCT_LIST']))
				continue;

			foreach($iblockData['PRODUCT_LIST'] as $productId)
			{
				if (isset($resultList[$productId]))
				{
					if (
						!empty($resultList[$productId][Base::FLAT_QUANTITY_LIST])
						&& is_array($resultList[$productId][Base::FLAT_QUANTITY_LIST])
					)
					{
						foreach (array_keys($resultList[$productId][Base::FLAT_QUANTITY_LIST]) as $index)
						{
							$resultList[$productId][Base::FLAT_QUANTITY_LIST][$index] = 1;
						}
					}
				}
			}
		}

		return $resultList;
	}