• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/catalogprovider.php
  • Класс: BitrixCatalogProductCatalogProvider
  • Вызов: CatalogProvider::checkExistsProductItemInStore
protected function checkExistsProductItemInStore(array $productData, array $storeDataList = array())
	{
		$result = new SaleResult();

		if (!empty($storeDataList))
		{
			foreach ($storeDataList as $storeData)
			{
				foreach ($storeData as $storeDataValue)
				{
					$storeId = $storeDataValue['STORE_ID'];

					if ((int)$storeId < -1 || (int)$storeId == 0
						|| !isset($storeDataValue["QUANTITY"]) || (int)$storeDataValue["QUANTITY"] < 0)
					{
						$result->addError(
							new SaleResultError(
								MainLocalizationLoc::getMessage(
									"DDCT_DEDUCTION_STORE_ERROR",
									self::getProductCatalogInfo($productData['PRODUCT_ID'])
								), "DDCT_DEDUCTION_STORE_ERROR"
							)
						);
						return $result;
					}
				}
			}
		}
		else
		{
			$result->addError( new SaleResultError(
				MainLocalizationLoc::getMessage("DDCT_DEDUCTION_STORE_ERROR", self::getProductCatalogInfo($productData['PRODUCT_ID'])),
				"DEDUCTION_STORE_ERROR1"
			));
		}

		return $result;
	}