• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/catalogprovider.php
  • Класс: BitrixCatalogProductCatalogProvider
  • Вызов: CatalogProvider::getAutoShipStoreData
static function getAutoShipStoreData(array $product, array $productStoreDataList)
	{
		$isMulti = false;
		if (isset($product['STORE_DATA_LIST']))
		{
			$storeData = [];
			$shipmentItemStoreData = reset($product['STORE_DATA_LIST']);
			if (!empty($shipmentItemStoreData))
			{
				$storeData = reset($shipmentItemStoreData);
			}

			if (!empty($storeData))
			{
				$isMulti = isset($storeData['IS_BARCODE_MULTI']) && $storeData['IS_BARCODE_MULTI'] === true;
			}
		}
		elseif (isset($product['IS_BARCODE_MULTI']))
		{
			$isMulti = $product['IS_BARCODE_MULTI'] === true;
		}

		if ($isMulti)
		{
			return false;
		}

		$outputStoreData = false;

		if (!empty($productStoreDataList))
		{
			$countProductInStore = 0;

			$storeProductData = false;
			foreach ($productStoreDataList as $storeData)
			{
				if ((float)$storeData['AMOUNT'] > 0)
				{
					$countProductInStore++;
					if (!$storeProductData)
					{
						$storeProductData = $storeData;
					}
				}
			}

			if ($countProductInStore == 1 && !empty($storeProductData))
			{
				$outputStoreData = $storeProductData;
			}
		}

		return $outputStoreData;
	}