$storeInformation = array('ID' => $prop["ID"], 'URL' => $storeURL, 'TITLE' => $storeName, 'PHONE' => $storePhone, 'SCHEDULE' => $storeSchedule, 'IMAGE_ID' => $storeImageId, 'EMAIL' => $storeEmail, 'COORDINATES' => $storeCoordinates, 'DESCRIPTION' => $storeDescription, 'AMOUNT' => $amount, 'REAL_AMOUNT' => $realAmount); $arResult["USER_FIELDS"] = $arParams["USER_FIELDS"]; $userFields = $USER_FIELD_MANAGER->GetUserFields('CAT_STORE', 0, $lang); foreach ($arResult["USER_FIELDS"] as $userField) { if (!empty($userField) && !empty($prop[$userField])) { ob_start(); $APPLICATION->IncludeComponent("bitrix:system.field.view", $userFields[$userField]["USER_TYPE_ID"], array("arUserField" => array_merge($userFields[$userField], array('VALUE' => $prop[$userField]))), null, array("HIDE_ICONS" => "Y")); $storeInformation["USER_FIELDS"][$userField] = array('CONTENT' => ob_get_contents(), 'TITLE' => strlen($userFields[$userField]['LIST_COLUMN_LABEL']) > 0 ? $userFields[$userField]['LIST_COLUMN_LABEL'] : $userField); ob_end_clean(); } } $arResult["STORES"][] = $storeInformation; } } if ($arParams["SHOW_GENERAL_STORE_INFORMATION"] == "Y") { $arResult["STORES"][] = array('ID' => 0, 'AMOUNT' => $arParams["USE_MIN_AMOUNT"] == 'Y' ? getStringCatalogStoreAmount($quantity, $arParams['MIN_AMOUNT']) : $quantity); } if ($arResult["IS_SKU"]) { $strMainId = $this->GetEditAreaId($arParams['ELEMENT_ID']); $strObName = 'ob' . preg_replace("/[^a-zA-Z0-9_]/", "x", $strMainId); $arResult['JS']['SKU'] = $productSku; $arResult['JS']['ID'] = $strObName; $arResult['JS']['MESSAGES'] = array('NOT_MUCH_GOOD' => GetMessage("NOT_MUCH_GOOD"), 'ABSENT' => GetMessage("ABSENT"), 'LOT_OF_GOOD' => GetMessage("LOT_OF_GOOD")); $arResult['JS']['SHOW_EMPTY_STORE'] = $arParams['SHOW_EMPTY_STORE'] == "Y"; $arResult['JS']["USE_MIN_AMOUNT"] = $arParams["USE_MIN_AMOUNT"] == 'Y'; $arResult['JS']["MIN_AMOUNT"] = $arParams["MIN_AMOUNT"]; $arResult['JS']['STORES'] = array(); if ($arParams["SHOW_GENERAL_STORE_INFORMATION"] == "Y") { $arResult['JS']['STORES'][] = 0; } elseif (!empty($arResult['STORES'])) { foreach ($arResult['STORES'] as $store) {
$storeInformation["USER_FIELDS"][$userField] = array( 'CONTENT' => ob_get_contents(), 'TITLE' => (strlen($userFields[$userField]['LIST_COLUMN_LABEL']) > 0) ? $userFields[$userField]['LIST_COLUMN_LABEL'] : $userField ); ob_end_clean(); } } $arResult["STORES"][] = $storeInformation; } } if ($arParams["SHOW_GENERAL_STORE_INFORMATION"] == "Y") $arResult["STORES"][] = array( 'ID' => 0, 'AMOUNT' => ($arParams["USE_MIN_AMOUNT"] == 'Y') ? getStringCatalogStoreAmount($quantity, $arParams['MIN_AMOUNT']) : $quantity ); if ($arResult["IS_SKU"]) { $strMainId = $this->GetEditAreaId($arParams['ELEMENT_ID']); $strObName = 'ob'.preg_replace("/[^a-zA-Z0-9_]/", "x", $strMainId); $arResult['JS']['SKU'] = $productSku; $arResult['JS']['ID'] = $strObName; $arResult['JS']['MESSAGES'] = array( 'NOT_MUCH_GOOD' => GetMessage("NOT_MUCH_GOOD"), 'ABSENT' => GetMessage("ABSENT"), 'LOT_OF_GOOD' => GetMessage("LOT_OF_GOOD") ); $arResult['JS']['SHOW_EMPTY_STORE'] = ($arParams['SHOW_EMPTY_STORE'] == "Y"); $arResult['JS']["USE_MIN_AMOUNT"] = ($arParams["USE_MIN_AMOUNT"] == 'Y');