diff --git a/local/components/evolution/about.career.vacancy/templates/.default/template.php b/local/components/evolution/about.career.vacancy/templates/.default/template.php index 68296e2..ff6b371 100644 --- a/local/components/evolution/about.career.vacancy/templates/.default/template.php +++ b/local/components/evolution/about.career.vacancy/templates/.default/template.php @@ -16,7 +16,7 @@ $this->setFrameMode(true);
Регион: $c = 0; foreach($arResult['PROPERTIES']['REGION']['RELATED'] AS $region): ?> = $region['NAME']; ?> diff --git a/local/components/evolution/about.leaders/templates/.default/template.php b/local/components/evolution/about.leaders/templates/.default/template.php index 1144323..04ecdd2 100644 --- a/local/components/evolution/about.leaders/templates/.default/template.php +++ b/local/components/evolution/about.leaders/templates/.default/template.php @@ -12,7 +12,7 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - if(count($arResult['LEADERS']) > 0): ?> + if(is_array($arResult['LEADERS']) && count($arResult['LEADERS']) > 0): ?>
Другие предложения = $arParams['BRAND_NAME']; ?> = $arParams['MODEL_NAME']; ?>
diff --git a/local/components/evolution/catalog.program/.description.php b/local/components/evolution/catalog.program/.description.php new file mode 100644 index 0000000..a20bdf3 --- /dev/null +++ b/local/components/evolution/catalog.program/.description.php @@ -0,0 +1,8 @@ + +if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); + +$arTemplateDescription = array( + "NAME" => GetMessage("DEFAULT_NAME"), + "DESCRIPTION" => GetMessage("DEFAULT_DESC"), +); +?> \ No newline at end of file diff --git a/local/components/evolution/catalog.program/.parameters.php b/local/components/evolution/catalog.program/.parameters.php new file mode 100644 index 0000000..0597273 --- /dev/null +++ b/local/components/evolution/catalog.program/.parameters.php @@ -0,0 +1,14 @@ + +if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); + +$arComponentParameters = array( + 'PARAMETERS' => array( + 'MAP_WIDTH' => array( + 'NAME' => GetMessage('COUNT_PER_PAGE'), + 'TYPE' => 'STRING', + 'DEFAULT' => '3', + 'PARENT' => 'BASE', + ), + ), +); +?> \ No newline at end of file diff --git a/local/components/evolution/catalog.program/component.php b/local/components/evolution/catalog.program/component.php new file mode 100644 index 0000000..81d89dd --- /dev/null +++ b/local/components/evolution/catalog.program/component.php @@ -0,0 +1,538 @@ + +if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); +/** @var CBitrixComponent $this */ +/** @var array $arParams */ +/** @var array $arResult */ +/** @var string $componentPath */ +/** @var string $componentName */ +/** @var string $componentTemplate */ +/** @global CDatabase $DB */ +/** @global CUser $USER */ +/** @global CMain $APPLICATION */ + +use Bitrix\Main\Context, + Bitrix\Main\Type\DateTime, + Bitrix\Main\Loader, + Bitrix\Iblock; + +global $NavNum; +$NavNum = 0; + +if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) +{ + if(CModule::IncludeModule('iblock')) + { + $breadcrumbs = []; + $canonical = []; + + $arResult = [ + 'SELECTED' => [], + 'TITLES' => [], + 'ITEMS' => [] + ]; + + $query = null; + $query_arr = []; + + $sort = Array("SORT" => "ASC", "NAME" => "ASC"); + if(isset($arParams['SORT'])) + { + if($arParams['SORT'] === "name") + { + $sort = Array("SORT" => "ASC", "NAME" => "ASC"); + $arResult['SCROLL'] = true; + } + if($arParams['SORT'] === "low") + { + $sort = Array("SORT" => "ASC", "PROPERTY_PRICE" => "ASC"); + $query_arr['SORT'] = $arParams['SORT']; + $arResult['SCROLL'] = true; + } + if($arParams['SORT'] === "high") + { + $sort = Array("SORT" => "ASC", "PROPERTY_PRICE" => "DESC"); + $query_arr['SORT'] = $arParams['SORT']; + $arResult['SCROLL'] = true; + } + + $arResult['SELECTED']['SORT'] = $arParams['SORT']; + } + $filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW); + $options = Array("nPageSize" => !empty($arParams['COUNT_PER_PAGE']) ? $arParams['COUNT_PER_PAGE'] : 15); + + $pages_url = $arParams['PATH']; + + $arResult['BRAND_DISABLED'] = false; + $arResult['MODEL_DISABLED'] = false; + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = false; + $arResult['FILTER_SMALL'] = $arParams['FILTER_SMALL'] ? true : false; + + $arResult['SHOW_BRANDS_LIST'] = true; + $arResult['SHOW_MODELS_LIST'] = false; + + if(empty($arParams['PROGRAM'])) + { + $arResult['SHOW_SPECIAL_OFFERS'] = true; + } + $arResult['SHOW_PROMO_BRANDS'] = true; + + if(!empty($arParams['BRAND'])) + { + $brands_res = CIBlockElement::GetList(["NAME" => "ASC"], ["IBLOCK_ID" => IBLOCK_ID_BRANDS, "CODE" => $arParams['BRAND']], false, []); + while ($brands_ob_element = $brands_res->GetNextElement()) + { + $brands_ar_res = $brands_ob_element->GetFields(); + $brands_ar_res['PROPERTIES'] = $brands_ob_element->GetProperties(); + + $filter['PROPERTY_BRAND'] = $brands_ar_res['ID']; + $pages_url = $pages_url.$brands_ar_res['CODE']."/"; + $arResult['SELECTED']['BRAND'] = $brands_ar_res['CODE']; + $arResult['SELECTED']['BRAND_ID'] = $brands_ar_res['ID']; + $arResult['SELECTED']['BRAND_UID'] = $brands_ar_res['PROPERTIES']['UID']['VALUE']; + $arResult['TITLES']['BRAND'] = $brands_ar_res['NAME']; + $arResult['TITLES']['TRANSCRIPTION'] = $brands_ar_res['PROPERTIES']['TRANSCRIPTION']['VALUE']; + + if($brands_ar_res['ACTIVE'] === "Y") + { + $arResult['BRAND_DISABLED'] = false; + $arResult['SHOW_BRANDS_LIST'] = false; + $arResult['SHOW_MODELS_LIST'] = true; + $arResult['MODEL_DISABLED'] = false; + } + else + { + $arResult['BRAND_DISABLED'] = true; + $arResult['MODEL_DISABLED'] = true; + $arResult['SHOW_MODELS_LIST'] = false; + } + + $arResult['SHOW_PROMO_BRANDS'] = false; + + array_push($breadcrumbs, [ + "NAME" => $brands_ar_res['NAME'], + "URL" => "https://".SITE_SERVER_NAME.$arParams['PATH'].$arResult['SELECTED']['BRAND']."/", + ]); + + array_push($canonical, $arParams['BRAND']); + } + + $arResult['EXTENDED'] = true; + $arResult['FILTER_SMALL'] = false; + $arResult['SCROLL'] = true; + + if(empty($arResult['SELECTED']['BRAND'])) + { + define('ERROR_404', 'Y'); + } + } + + if(!empty($arParams['MODEL'])) + { + $models_res = CIBlockElement::GetList(["NAME" => "ASC"], ["IBLOCK_ID" => IBLOCK_ID_MODELS, "CODE" => $arParams['MODEL'], "PROPERTY_BRAND_UID" => $arResult['SELECTED']['BRAND_UID']], false, []); + while ($models_ob_element = $models_res->GetNextElement()) + { + $models_ar_res = $models_ob_element->GetFields(); + $models_ar_res['PROPERTIES'] = $models_ob_element->GetProperties(); + + $filter['PROPERTY_MODEL'] = $models_ar_res['ID']; + $pages_url = $pages_url.$models_ar_res['CODE']."/"; + $arResult['SELECTED']['MODEL'] = $models_ar_res['CODE']; + $arResult['TITLES']['MODEL'] = $models_ar_res['NAME']; + + if($models_ar_res['ACTIVE'] === "Y") + { + $arResult['MODEL_DISABLED'] = false; + $arResult['SHOW_MODELS_LIST'] = false; + } + else + { + $arResult['MODEL_DISABLED'] = true; + $arResult['SHOW_PROMO_BRANDS'] = false; + } + + array_push($breadcrumbs, [ + "NAME" => $models_ar_res['NAME'], + "URL" => "https://".SITE_SERVER_NAME.$arParams['PATH'].$arResult['SELECTED']['BRAND']."/".$arResult['SELECTED']['MODEL']."/", + ]); + + array_push($canonical, $arParams['MODEL']); + + if(!is_null($arParams['REGION']) && $arParams['REGION'] !== "root") + { + if($models_ar_res['PROPERTIES']['REGIONS']['VALUE'] !== "Да") + { + $APPLICATION->SetPageProperty("robots", "noindex, nofollow"); + } + } + } + + $arResult['EXTENDED'] = true; + $arResult['SCROLL'] = true; + + if(empty($arResult['SELECTED']['MODEL'])) + { + define('ERROR_404', 'Y'); + } + } + + if(isset($arParams['MODIFICATION'])) + { + if(!empty($arParams['MODIFICATION'])) + { + $arResult['EXTENDED'] = true; + $arResult['SELECTED']['MODIFICATION'] = $arParams['MODIFICATION']; + $arResult['SCROLL'] = true; + + $filter['PROPERTY_MODIFICATION'] = $arParams['MODIFICATION']; + $query_arr['MODIFICATION'] = $arParams['MODIFICATION']; + } + else + { + LocalRedirect("https://".SITE_SERVER_NAME.$arParams['PATH'].$arResult['SELECTED']['BRAND']."/".$arResult['SELECTED']['MODEL']."/", true, "301 Moved permanently"); + } + } + + $parameters_filter_count = 0; + + if(!empty($arParams['DRIVE'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $arResult['SELECTED']['DRIVE'] = $arParams['DRIVE']; + $filter['=PROPERTY_DRIVE'] = $arParams['DRIVE']; + + $query_arr['DRIVE'] = $arParams['DRIVE']; + } + + if(!empty($arParams['GEAR'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $arResult['SELECTED']['GEAR'] = $arParams['GEAR']; + $filter['=PROPERTY_GEAR'] = $arParams['GEAR']; + + $query_arr['GEAR'] = $arParams['GEAR']; + } + + if(!empty($arParams['ENGINE_FUEL'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $arResult['SELECTED']['ENGINE_FUEL'] = $arParams['ENGINE_FUEL']; + $filter['=PROPERTY_ENGINE_FUEL'] = $arParams['ENGINE_FUEL']; + + $query_arr['ENGINE_FUEL'] = $arParams['ENGINE_FUEL']; + } + + if(!empty($arParams['ENGINE_POWER_FROM']) || !empty($arParams['ENGINE_POWER_TO'])) + { + $parameters_filter_count++; + + $arResult['EXTENDED'] = true; + $arResult['BY_OPTIONS'] = true; + $arResult['SCROLL'] = true; + + $filter['>
+ Автомобили = $arResult['TITLES']['BRAND']; ?> на данный момент отсутствуют в каталоге, но это не означает, что мы не сможем их для Вас найти. Оставьте заявку или позвоните по номеру горячей линии 8 800 333 75 75 и мы найдём Вам автомобиль!
+Посмотрите автомобили других марок:
+ else: ?> + if($arResult['MODEL_DISABLED']): ?> +Модель = $arResult['TITLES']['BRAND']; ?> = $arResult['TITLES']['MODEL']; ?> на данный момент отсутствует в каталоге, но это не означает, что мы не сможем её для Вас найти. Оставьте заявку или позвоните по номеру горячей линии 8 800 333 75 75 и мы найдём Вам автомобиль!
+ /* +Посмотрите другие модели = $arResult['TITLES']['BRAND']; ?>:
+ */?> + + $APPLICATION->IncludeComponent( + "evolution:catalog.light", + isset($_REQUEST['ajax']) ? "ajax" : "", + array( + "TITLE" => "Посмотрите похожие автомобили на ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL'], + "PAGINATION" => "Y", + "COUNT_PER_PAGE" => 3, + //"BODY" => $_REQUEST['BODY'], + //"BODY_SLUG" => $_REQUEST['BODY_SLUG'], + //"SORT" => $_REQUEST['SORT'], + "PATH" => "/catalog/", + ) + ); + ?> + endif; ?> + endif; ?> + + if($arParams['REGION'] !== "root"): ?> + $APPLICATION->IncludeComponent( + "evolution:catalog.city.team", + "", + Array( + "CITY" => $arResult['CITY'], + "BRAND" => $arResult['TITLES']['BRAND'], + "MODEL" => $arResult['TITLES']['MODEL'], + "EXTENDED" => $arResult['EXTENDED'], + ) + ); ?> + endif; ?> + + if($arResult['SHOW_SPECIAL_OFFERS']): ?> + $APPLICATION->IncludeComponent( + "evolution:catalog.special.offers", + "", + Array( + "COUNT" => 3, + "EXTENDED" => $arResult['EXTENDED'], + "BRAND_ID" => $arResult['SELECTED']['BRAND_ID'], + ) + ); ?> + endif; ?> + + if($arResult['SHOW_PROMO_BRANDS']): ?> + $APPLICATION->IncludeComponent( + "evolution:catalog.promo.brand", + "", + Array( + "COUNT" => 3, + "PATH" => $arParams['PATH'], + "FILTER_ARRAY" => [ "PROPERTY_PROMO_TAXI_VALUE" => "Да", ], + ) + ); ?> + endif; ?> + + if($arResult['SHOW_PROMO_MODELS']): ?> + $APPLICATION->IncludeComponent( + "evolution:catalog.promo.model", + "", + Array( + "COUNT" => 3, + "BRAND_NAME" => $arResult['TITLES']['BRAND'], + "BRAND_CODE" => $arResult['SELECTED']['BRAND'], + "BRAND_UID" => $arResult['SELECTED']['BRAND_UID'], + "PATH" => $arParams['PATH'], + ) + ); ?> + endif; ?> + + if(is_array($arResult['ITEMS']) && count($arResult['ITEMS']) > 0): ?> +Рекомендуемые модели = $arParams['BRAND_NAME']; ?> для Вас
diff --git a/local/components/evolution/catalog.special.offers/templates/.default/template.php b/local/components/evolution/catalog.special.offers/templates/.default/template.php index 9f5e079..29da1f7 100644 --- a/local/components/evolution/catalog.special.offers/templates/.default/template.php +++ b/local/components/evolution/catalog.special.offers/templates/.default/template.php @@ -12,7 +12,7 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - if(count($arResult['ITEMS']) > 0): ?> + if(is_array($arResult['ITEMS']) && count($arResult['ITEMS']) > 0): ?>