additional check for template countable arrays for PHP 8.0+
This commit is contained in:
parent
a8646ffccd
commit
a627003518
@ -16,7 +16,7 @@ $this->setFrameMode(true);
|
||||
<div class="container">
|
||||
<h1 class="section_title"><?= $arResult['NAME']; ?></h1>
|
||||
<div class="vacancy">
|
||||
<? if(!is_null($arResult['PROPERTIES']['REGION']['RELATED']) && count($arResult['PROPERTIES']['REGION']['RELATED']) > 0): ?>
|
||||
<? if(!is_null($arResult['PROPERTIES']['REGION']['RELATED']) && is_array($arResult['PROPERTIES']['REGION']['RELATED']) && count($arResult['PROPERTIES']['REGION']['RELATED']) > 0): ?>
|
||||
<p><strong>Регион:</strong>
|
||||
<? $c = 0; foreach($arResult['PROPERTIES']['REGION']['RELATED'] AS $region): ?>
|
||||
<?= $region['NAME']; ?>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<? if(count($arResult['LEADERS']) > 0): ?>
|
||||
<? if(is_array($arResult['LEADERS']) && count($arResult['LEADERS']) > 0): ?>
|
||||
<h2>Руководство</h2>
|
||||
<div class="management">
|
||||
<? foreach($arResult['LEADERS'] AS $leader): ?>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<? if(count($arResult['ITEMS']) > 0): ?>
|
||||
<? if(is_array($arResult['ITEMS']) && count($arResult['ITEMS']) > 0): ?>
|
||||
<div class="recom_models">
|
||||
<div class="title_wrapper">
|
||||
<p class="title">Другие предложения <?= $arParams['BRAND_NAME']; ?> <?= $arParams['MODEL_NAME']; ?></p>
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
<?
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
|
||||
$arTemplateDescription = array(
|
||||
"NAME" => GetMessage("DEFAULT_NAME"),
|
||||
"DESCRIPTION" => GetMessage("DEFAULT_DESC"),
|
||||
);
|
||||
?>
|
||||
14
local/components/evolution/catalog.program/.parameters.php
Normal file
14
local/components/evolution/catalog.program/.parameters.php
Normal file
@ -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',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
538
local/components/evolution/catalog.program/component.php
Normal file
538
local/components/evolution/catalog.program/component.php
Normal file
@ -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['><PROPERTY_ENGINE_POWER'] = [ !empty($arParams['ENGINE_POWER_FROM']) ? $arParams['ENGINE_POWER_FROM'] : 0, !empty($arParams['ENGINE_POWER_TO']) ? $arParams['ENGINE_POWER_TO'] : 1000 ];
|
||||
|
||||
if(!empty($arParams['ENGINE_POWER_FROM']))
|
||||
{
|
||||
$arResult['SELECTED']['ENGINE_POWER_FROM'] = $arParams['ENGINE_POWER_FROM'];
|
||||
$query_arr['ENGINE_POWER_FROM'] = $arParams['ENGINE_POWER_FROM'];
|
||||
}
|
||||
if(!empty($arParams['ENGINE_POWER_TO']))
|
||||
{
|
||||
$arResult['SELECTED']['ENGINE_POWER_TO'] = $arParams['ENGINE_POWER_TO'];
|
||||
$query_arr['ENGINE_POWER_TO'] = $arParams['ENGINE_POWER_TO'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arParams['ENGINE_VOLUME_FROM']) || !empty($arParams['ENGINE_VOLUME_TO']))
|
||||
{
|
||||
$parameters_filter_count++;
|
||||
|
||||
$arResult['EXTENDED'] = true;
|
||||
$arResult['BY_OPTIONS'] = true;
|
||||
$arResult['SCROLL'] = true;
|
||||
|
||||
$filter['><PROPERTY_ENGINE_VOLUME'] = [ !empty($arParams['ENGINE_VOLUME_FROM']) ? $arParams['ENGINE_VOLUME_FROM'] : 0, !empty($arParams['ENGINE_VOLUME_TO']) ? $arParams['ENGINE_VOLUME_TO'] : 10000 ];
|
||||
|
||||
if(!empty($arParams['ENGINE_VOLUME_FROM']))
|
||||
{
|
||||
$arResult['SELECTED']['ENGINE_VOLUME_FROM'] = $arParams['ENGINE_VOLUME_FROM'];
|
||||
$query_arr['ENGINE_VOLUME_FROM'] = $arParams['ENGINE_VOLUME_FROM'];
|
||||
}
|
||||
if(!empty($arParams['ENGINE_VOLUME_TO']))
|
||||
{
|
||||
$arResult['SELECTED']['ENGINE_VOLUME_TO'] = $arParams['ENGINE_VOLUME_TO'];
|
||||
$query_arr['ENGINE_VOLUME_TO'] = $arParams['ENGINE_VOLUME_TO'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arParams['BODY']))
|
||||
{
|
||||
$arResult['EXTENDED'] = true;
|
||||
$arResult['BY_OPTIONS'] = true;
|
||||
$arResult['SCROLL'] = true;
|
||||
|
||||
$arResult['SELECTED']['BODY'] = $arParams['BODY'];
|
||||
$filter['=PROPERTY_BODY'] = $arParams['BODY'];
|
||||
|
||||
$query_arr['BODY'] = $arParams['BODY'];
|
||||
}
|
||||
|
||||
if(count($query_arr) > 0)
|
||||
{
|
||||
$query = http_build_query($query_arr);
|
||||
}
|
||||
|
||||
if($arParams['leasing_program'] && $arParams['leasing_program'] !== "")
|
||||
{
|
||||
$filter['PROPERTY_LEASING_PROGRAMS'] = $arParams["leasing_program"];
|
||||
}
|
||||
|
||||
if(!empty($arParams['BRAND']))
|
||||
{
|
||||
if($arResult['BRAND_DISABLED'])
|
||||
{
|
||||
$arResult['SHOW_PROMO_BRANDS'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arParams['BRAND']) && empty($arParams['MODEL']))
|
||||
{
|
||||
$arResult['SHOW_PROMO_MODELS'] = true;
|
||||
|
||||
if($arResult['BRAND_DISABLED'])
|
||||
{
|
||||
$arResult['SHOW_PROMO_BRANDS'] = false;
|
||||
$arResult['SHOW_PROMO_MODELS'] = false;
|
||||
}
|
||||
|
||||
if($arResult['MODEL_DISABLED'])
|
||||
{
|
||||
$arResult['SHOW_PROMO_BRANDS'] = false;
|
||||
$arResult['SHOW_PROMO_MODELS'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arParams['BRAND']) && !empty($arParams['MODEL']))
|
||||
{
|
||||
if($arResult['MODEL_DISABLED'])
|
||||
{
|
||||
$arResult['SHOW_PROMO_BRANDS'] = false;
|
||||
$arResult['SHOW_PROMO_MODELS'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arParams['PROGRAM']))
|
||||
{
|
||||
$arResult['BRAND_DISABLED'] = false;
|
||||
$arResult['MODEL_DISABLED'] = false;
|
||||
}
|
||||
|
||||
if(!empty($arParams['MODEL']) || $arResult['BY_OPTIONS'])
|
||||
{
|
||||
if(!$arResult['BRAND_DISABLED'] && !$arResult['MODEL_DISABLED'])
|
||||
{
|
||||
$arResult['SHOW_SPECIAL_OFFERS'] = false;
|
||||
$arResult['SHOW_PROMO_BRANDS'] = false;
|
||||
$arResult['SHOW_PROMO_MODELS'] = false;
|
||||
|
||||
$res = CIBlockElement::GetList($sort, $filter, false, $options);
|
||||
|
||||
while ($obElement = $res->GetNextElement())
|
||||
{
|
||||
$ar_res = $obElement->GetFields();
|
||||
$ar_res['PROPERTIES'] = $obElement->GetProperties();
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(IBLOCK_ID_MODIFICATIONS, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
|
||||
$ar_res['CALCULATION'] = [];
|
||||
$ar_res['CALCULATION']['MONTHLY'] = number_format(($ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
|
||||
$arResult['ITEMS'][] = $ar_res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($_REQUEST['PAGEN_1'] > 1)
|
||||
{
|
||||
$arResult['SCROLL'] = true;
|
||||
}
|
||||
|
||||
if(!empty($arResult['TITLES']['BRAND']))
|
||||
{
|
||||
if(!empty($arResult['TITLES']['MODEL']))
|
||||
{
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг для юридических лиц и ИП в Москве - купить новый автомобиль ".$arResult['TITLES']['TRANSCRIPTION']." ".$arResult['TITLES']['MODEL']." в лизинг | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
}
|
||||
else
|
||||
{
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." в лизинг для юридических лиц и ИП в Москве - купить новый автомобиль ".$arResult['TITLES']['TRANSCRIPTION']." в лизинг | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".$arResult['TITLES']['BRAND']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
}
|
||||
}
|
||||
|
||||
$arResult['SECTION_CODE'] = !empty($arParams['section_code']) ? $arParams['section_code'] : $pages_url;
|
||||
$arResult['QUERY'] = $query;
|
||||
|
||||
if(count($arResult['ITEMS']) > 0 && $arParams["PAGINATION"] == "Y")
|
||||
{
|
||||
$arResult["NAV_STRING"] = $res->GetPageNavStringEx(
|
||||
$navComponentObject,
|
||||
"",
|
||||
"catalog",
|
||||
"N",
|
||||
null,
|
||||
[
|
||||
"section_code" => $arResult['SECTION_CODE'],
|
||||
"query" => $arResult['QUERY'],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$arResult['PAGE_CURRENT'] = $res->NavPageNomer;
|
||||
$arResult['PAGE_COUNT'] = $res->NavPageCount;
|
||||
|
||||
if(!is_null($arParams['REGION']))
|
||||
{
|
||||
if($arParams['REGION'] === "root")
|
||||
{
|
||||
$arResult['TITLE'] = "Лизинг в регионах России";
|
||||
$arResult['SUBTITLE'] = " для юридических лиц и ИП";
|
||||
|
||||
$APPLICATION->SetPageProperty("title", "Лизинг в регионах России для юридических лиц и ИП | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Лизинговая компания Эволюция предлагает быстрое оформление авто в лизинг в регионах России для юридических лиц и ИП. Выгодные цены, спецпредложения, простое оформление, консультирование и сопровождение.");
|
||||
$APPLICATION->SetPageProperty("keywords", "Лизинг в России, лизинг в регионах России");
|
||||
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/regions/"/>');
|
||||
}
|
||||
else
|
||||
{
|
||||
//IBLOCK_ID_CITIES
|
||||
$res_city = CIBlockElement::GetList([], [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CITIES, "CODE" => $arParams['REGION'] ], false, []);
|
||||
|
||||
while ($city_element = $res_city->GetNextElement())
|
||||
{
|
||||
$ar_city = $city_element->GetFields();
|
||||
$ar_city['PROPERTIES'] = $city_element->GetProperties();
|
||||
|
||||
$ar_city['PROPERTIES']['OFFICES']['RELATED'] = get_related_array(IBLOCK_ID_CONTACTS, $ar_city['PROPERTIES']['OFFICES']['VALUE']);
|
||||
|
||||
if(isset($ar_city['PROPERTIES']['OFFICES']['RELATED'][0]))
|
||||
{
|
||||
$ar_city['LEADER_CRM_ID'] = $ar_city['PROPERTIES']['LEADER_CRM_ID']['VALUE'];
|
||||
}
|
||||
|
||||
$arResult['CITY'] = $ar_city;
|
||||
|
||||
array_unshift($breadcrumbs, [
|
||||
"NAME" => $ar_city['NAME'],
|
||||
"URL" => "https://".SITE_SERVER_NAME."/regions/".$ar_city['CODE']."/",
|
||||
]);
|
||||
|
||||
array_unshift($canonical, $ar_city['CODE']);
|
||||
|
||||
if(!empty($arResult['SELECTED']['MODEL']))
|
||||
{
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП. Вы можете купить ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
$APPLICATION->SetPageProperty("keywords", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." ".$ar_city['NAME']." в лизинг, купить ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." ".$ar_city['NAME']." в лизинг");
|
||||
}
|
||||
elseif(!empty($arResult['SELECTED']['BRAND']))
|
||||
{
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг для юридических лиц и ИП. Вы можете купить ".$arResult['TITLES']['BRAND']." в ".$ar_city['PROPERTIES']['CASE']['VALUE']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
$APPLICATION->SetPageProperty("keywords", $arResult['TITLES']['BRAND']." ".$ar_city['NAME']." в лизинг, купить ".$arResult['TITLES']['BRAND']." ".$ar_city['NAME']." в лизинг");
|
||||
}
|
||||
else
|
||||
{
|
||||
$APPLICATION->SetPageProperty("title", "Лизинг в ".$ar_city['PROPERTIES']['CASE']['VALUE']." для юридических лиц и ИП | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Лизинговая компания Эволюция предлагает быстрое оформление авто в лизинг в ".$ar_city['PROPERTIES']['CASE']['VALUE']." для юридических лиц и ИП. Выгодные цены, спецпредложения, простое оформление, консультирование и сопровождение.");
|
||||
$APPLICATION->SetPageProperty("keywords", "Лизинг в ".$ar_city['PROPERTIES']['CASE']['VALUE'].", лизинг авто ".$ar_city['NAME'].", купить машину в лизинг ".$ar_city['NAME']."");
|
||||
}
|
||||
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/regions/'.implode("/", $canonical).(count($canonical) > 0 ? "/" : "").'"/>');
|
||||
}
|
||||
|
||||
if(!isset($ar_city))
|
||||
{
|
||||
define('ERROR_404', 'Y');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isset($arParams['PROGRAM']))
|
||||
{
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/catalog/'.implode("/", $canonical).(count($canonical) > 0 ? "/" : "").'"/>');
|
||||
}
|
||||
}
|
||||
|
||||
if($arResult['MODEL_DISABLED'])
|
||||
{
|
||||
$arResult['MODEL'] = null;
|
||||
$arResult['SELECTED']['MODEL'] = null;
|
||||
$arResult['SELECTED']['MODEL_ID'] = null;
|
||||
$arResult['SELECTED']['MODEL_UID'] = null;
|
||||
$arResult['SHOW_SPECIAL_OFFERS'] = false;
|
||||
}
|
||||
|
||||
if($arResult['BRAND_DISABLED'])
|
||||
{
|
||||
$arResult['BRAND'] = null;
|
||||
$arResult['SELECTED']['BRAND'] = null;
|
||||
$arResult['SELECTED']['BRAND_ID'] = null;
|
||||
$arResult['SELECTED']['BRAND_UID'] = null;
|
||||
$arResult['SHOW_SPECIAL_OFFERS'] = false;
|
||||
}
|
||||
|
||||
foreach($breadcrumbs AS $breadcrumb)
|
||||
{
|
||||
$APPLICATION->AddChainItem($breadcrumb['NAME'], $breadcrumb['URL']);
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['ajax']))
|
||||
{
|
||||
$GLOBALS['APPLICATION']->RestartBuffer();
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
$items = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
$response = [
|
||||
'ITEMS' => json_encode(str_replace(["\t","\r","\n"], ["","",""], $items), JSON_UNESCAPED_SLASHES),
|
||||
'PAGE_CURRENT' => $arResult['PAGE_CURRENT'],
|
||||
'PAGE_COUNT' => $arResult['PAGE_COUNT'],
|
||||
'PAGINATION' => json_encode(str_replace(["\t","\r","\n"], ["","",""], $arResult['NAV_STRING']), JSON_UNESCAPED_SLASHES),
|
||||
];
|
||||
|
||||
print json_encode($response, JSON_UNESCAPED_SLASHES);
|
||||
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$MESS ['DEFAULT_NAME'] = "Каталог ЛКТ";
|
||||
$MESS ['DEFAULT_DESC'] = "Каталог ЛКТ";
|
||||
?>
|
||||
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
$MESS["COUNT_PER_PAGE"] = "Количество предложений на страницу";
|
||||
@ -0,0 +1,26 @@
|
||||
var section_code = "";
|
||||
var query = "";
|
||||
var page = 2;
|
||||
|
||||
$(function()
|
||||
{
|
||||
page = parseInt($("#current_page").val(), 10) + 1;
|
||||
|
||||
$("#catalog_get_more").on("click", function()
|
||||
{
|
||||
var url = section_code+"page-"+page+"/";
|
||||
url += query !== "" ? "?"+query+"&ajax" : "?ajax";
|
||||
|
||||
$.get(url, {}, function(response)
|
||||
{
|
||||
page++;
|
||||
$(".pagination").replaceWith(JSON.parse(response['PAGINATION']));
|
||||
$("#catalog_positions_list").append(JSON.parse(response['ITEMS']));
|
||||
|
||||
if(parseInt(response['PAGE_COUNT'], 10) === parseInt(response['PAGE_CURRENT'], 10))
|
||||
{
|
||||
$("#catalog_get_more").empty();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,313 @@
|
||||
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @global CMain $APPLICATION */
|
||||
/** @global CUser $USER */
|
||||
/** @global CDatabase $DB */
|
||||
/** @var CBitrixComponentTemplate $this */
|
||||
/** @var string $templateName */
|
||||
/** @var string $templateFile */
|
||||
/** @var string $templateFolder */
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
|
||||
$title = "";
|
||||
$subtitle = "";
|
||||
|
||||
if(!empty($arParams['REGION']) && $arParams['REGION'] !== "root")
|
||||
{
|
||||
//$title = "Лизинг";
|
||||
|
||||
if(!empty($arResult['TITLES']['BRAND']))
|
||||
{
|
||||
$title .= " ".$arResult['TITLES']['BRAND'];
|
||||
|
||||
if(!empty($arResult['TITLES']['MODEL']))
|
||||
{
|
||||
$title = $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL'];
|
||||
}
|
||||
$title = $title." в ".$arResult['CITY']['PROPERTIES']['CASE']['VALUE']." в лизинг";
|
||||
$subtitle = " для юридических лиц и ИП";
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = "Лизинг в ".$arResult['CITY']['PROPERTIES']['CASE']['VALUE'];
|
||||
$subtitle = " для юридических лиц и ИП";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($arResult['TITLES']['BRAND']))
|
||||
{
|
||||
$title .= "Новые автомобили ".$arResult['TITLES']['BRAND'];
|
||||
|
||||
if(!empty($arResult['TITLES']['MODEL']))
|
||||
{
|
||||
$title = $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL'];
|
||||
}
|
||||
|
||||
$subtitle = " в лизинг для юридических лиц и ИП";
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arResult['TITLE']))
|
||||
{
|
||||
$title = $arResult['TITLE'];
|
||||
}
|
||||
|
||||
if(!empty($arResult['SUBTITLE']))
|
||||
{
|
||||
$subtitle = $arResult['SUBTITLE'];
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
section_code = "<?= $arResult['SECTION_CODE']; ?>";
|
||||
query = "<?= $arResult['QUERY']; ?>";
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
main {overflow-x: unset;}
|
||||
</style>
|
||||
<section data-page="catalog" id="catalog">
|
||||
<div class="container">
|
||||
<div id="view"></div>
|
||||
<div class="pageWithSide">
|
||||
<div class="leftColumn">
|
||||
<? if($arParams['PROGRAM'] !== "" && !is_null($arParams['PROGRAM'])): ?>
|
||||
<h2 class="section_title_with_em"><em><?= !empty($title) ? $title : "Новые автомобили в лизинг"; ?></em><?= $subtitle !== "" ? "<br>".$subtitle : ""; ?></h2>
|
||||
<? else: ?>
|
||||
<h1 class="section_title_with_em"><em><?= !empty($title) ? $title : "Новые автомобили в лизинг"; ?></em><?= $subtitle !== "" ? "<br>".$subtitle : ""; ?></h1>
|
||||
<? endif; ?>
|
||||
<div class="special_detail">
|
||||
<? if(!$arParams['top_banners']): ?>
|
||||
<? else: ?>
|
||||
<div class="special_offer">
|
||||
<h2>СКИДКИ ДО <span>1,5%</span> <mark>+</mark> СПЕЦТАРИФ НА КАСКО</h2>
|
||||
<ul class="list-column">
|
||||
<li>Скидки до 1,5% при покупке</li>
|
||||
<li>Land Rover в лизинг</li>
|
||||
<li>Специальный тариф на каско</li>
|
||||
</ul>
|
||||
<button class="button button-blue">Отправить заявку</button>
|
||||
<img src="/images/special_offer.jpg" alt="" />
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div id="catalog_small_filter" style="<?= $arResult['EXTENDED'] ? "display:none;" : ($arResult['FILTER_SMALL'] ? "display:none;" : ""); ?>">
|
||||
<form id="catalog_small_form" method="get" action="/catalog/">
|
||||
<div class="filter_body">
|
||||
<div class="form_field">
|
||||
<select name="brand" id="small_filter_brands">
|
||||
<option disabled selected value="">Марка</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select name="model" id="small_filter_models">
|
||||
<option disabled selected value="">Модель</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="button button-blue" id="catalog_small_find"></button>
|
||||
<button class="button button-blue" id="rich_filter_toggle">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.63025 3H13.3697C13.4666 3 13.5613 3.02814 13.6425 3.08099C13.7237 3.13384 13.7878 3.20914 13.827 3.29772C13.8661 3.38631 13.8788 3.48437 13.8633 3.57999C13.8478 3.6756 13.8048 3.76466 13.7397 3.83634L9.63 8.35697C9.54633 8.449 9.49997 8.56892 9.49997 8.6933V12.2324C9.49997 12.3147 9.47965 12.3958 9.44081 12.4683C9.40197 12.5409 9.34581 12.6028 9.27732 12.6484L7.27732 13.9818C7.20202 14.032 7.11451 14.0608 7.02412 14.0652C6.93372 14.0695 6.84384 14.0493 6.76404 14.0066C6.68425 13.9639 6.61755 13.9003 6.57104 13.8227C6.52454 13.745 6.49997 13.6562 6.49997 13.5657V8.6933C6.49997 8.56892 6.45361 8.449 6.36994 8.35697L2.26028 3.83634C2.19512 3.76466 2.15218 3.6756 2.13669 3.57999C2.12119 3.48437 2.13381 3.38631 2.17299 3.29772C2.21218 3.20914 2.27625 3.13384 2.35743 3.08099C2.4386 3.02814 2.53338 3 2.63025 3V3Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
Фильтр
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="filter" class="filter_in_catalog" style="<?= $arResult['EXTENDED'] ? "display:block;" : ""; ?>">
|
||||
<div class="container">
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:form.catalog.filter",
|
||||
"",
|
||||
Array(
|
||||
"SWITCH" => false,
|
||||
"SELECTED" => $arResult['SELECTED'],
|
||||
"PATH" => $arParams['PATH'],
|
||||
"SORTING" => true,
|
||||
"PROGRAM" => $arParams['PROGRAM'],
|
||||
"SCROLL" => $arResult['SCROLL'],
|
||||
)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
<? if($arParams['REGION'] === "root"): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.cities.list",
|
||||
"",
|
||||
Array(
|
||||
"TITLE" => "Выберите город",
|
||||
)
|
||||
); ?>
|
||||
<? endif; ?>
|
||||
<? if(is_array($arResult['ITEMS']) && count($arResult['ITEMS']) > 0): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.sort",
|
||||
"",
|
||||
Array(
|
||||
"SORT" => $arParams['SORT'],
|
||||
"FILTER" => $arResult['FILTER_SMALL'],
|
||||
)
|
||||
); ?>
|
||||
<? else: ?>
|
||||
<div class="catalog_sort">
|
||||
<div class="sort_container sort_selector">
|
||||
</div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<? if($arResult['BRAND_DISABLED'] && $arResult['MODEL_DISABLED']): ?>
|
||||
<p style="font-size: 18px; line-height: 24px; padding: 10px 40px 40px 0px; border-left: solid 1px white;">Автомобили <b><?= $arResult['TITLES']['BRAND']; ?></b> на данный момент отсутствуют в каталоге, но это не означает, что мы не сможем их для Вас найти. Оставьте <a href="#order">заявку</a> или позвоните по номеру горячей линии <a href="tel:88003337575">8 800 333 75 75</a> и мы найдём Вам автомобиль!</p>
|
||||
<p style="font-size: 18px; line-height: 24px; padding: 0px 40px 40px 0px; border-left: solid 1px white;">Посмотрите автомобили других марок:</p>
|
||||
<? else: ?>
|
||||
<? if($arResult['MODEL_DISABLED']): ?>
|
||||
<p style="font-size: 18px; line-height: 24px; padding: 10px 40px 40px 0px; border-left: solid 1px white;">Модель <b><?= $arResult['TITLES']['BRAND']; ?> <?= $arResult['TITLES']['MODEL']; ?></b> на данный момент отсутствует в каталоге, но это не означает, что мы не сможем её для Вас найти. Оставьте <a href="#order">заявку</a> или позвоните по номеру горячей линии <a href="tel:88003337575">8 800 333 75 75</a> и мы найдём Вам автомобиль!</p>
|
||||
<? /*
|
||||
<p style="font-size: 18px; line-height: 24px; padding: 0px 40px 40px 0px; border-left: solid 1px white;">Посмотрите другие модели <?= $arResult['TITLES']['BRAND']; ?>:</p>
|
||||
*/?>
|
||||
<?
|
||||
$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): ?>
|
||||
<div class="catalog_list" id="catalog_positions_list">
|
||||
<? foreach($arResult['ITEMS'] AS $arItem): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.list.item",
|
||||
"",
|
||||
$arItem
|
||||
); ?>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
<? if($arResult['PAGE_COUNT'] > 1 && $arResult['PAGE_CURRENT'] != $arResult['PAGE_COUNT']): ?>
|
||||
<input type="hidden" id="current_page" value="<?= $arResult['PAGE_CURRENT']; ?>"/>
|
||||
<a class="catalog_show_more_button" id="catalog_get_more" style="cursor:pointer;">
|
||||
<span>Показать еще</span>
|
||||
</a>
|
||||
<? endif; ?>
|
||||
<?= $arResult['NAV_STRING']; ?>
|
||||
<? endif; ?>
|
||||
|
||||
<? if($arResult['SHOW_BRANDS_LIST']): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.brands",
|
||||
"",
|
||||
Array(
|
||||
"PATH" => $arParams['PATH'],
|
||||
"TITLE" => "Каталог автомобилей",
|
||||
"SORT" => $arParams['SORT'],
|
||||
"FILTER" => $arResult['FILTER_SMALL'],
|
||||
"BRANDS_FILTER" => ["PROPERTY_TAXI_VALUE" => "Да"],
|
||||
)
|
||||
); ?>
|
||||
<? endif; ?>
|
||||
<? if($arResult['SHOW_MODELS_LIST']): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.models",
|
||||
"",
|
||||
Array(
|
||||
"PATH" => $arParams['PATH'],
|
||||
"BRAND" => $_REQUEST['BRAND'],
|
||||
"RECOMMENDED" => true,
|
||||
"REGIONS" => !is_null($arParams['REGION']) ? true : false,
|
||||
)
|
||||
); ?>
|
||||
<? endif; ?>
|
||||
|
||||
<? if(isset($arParams['REGION']) && $arParams['REGION'] !== "root"): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.city.offices",
|
||||
"",
|
||||
Array(
|
||||
"CITY" => $arResult['CITY'],
|
||||
)
|
||||
); ?>
|
||||
<? endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<aside class="rightColumn">
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:banner.inner",
|
||||
"",
|
||||
Array(
|
||||
)
|
||||
); ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:banner.ask",
|
||||
"",
|
||||
Array(
|
||||
)
|
||||
); ?>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@ -0,0 +1,22 @@
|
||||
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @global CMain $APPLICATION */
|
||||
/** @global CUser $USER */
|
||||
/** @global CDatabase $DB */
|
||||
/** @var CBitrixComponentTemplate $this */
|
||||
/** @var string $templateName */
|
||||
/** @var string $templateFile */
|
||||
/** @var string $templateFolder */
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
|
||||
?>
|
||||
<? foreach($arResult['ITEMS'] AS $arItem): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.list.item",
|
||||
"",
|
||||
$arItem
|
||||
); ?>
|
||||
<? endforeach; ?>
|
||||
@ -12,9 +12,9 @@
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<? if(count($arResult['BRANDS']) > 0): ?>
|
||||
<? if(is_array($arResult['BRANDS']) && count($arResult['BRANDS']) > 0): ?>
|
||||
<? foreach($arResult['BRANDS'] AS $brand): ?>
|
||||
<? if(count($brand['ITEMS']) > 0): ?>
|
||||
<? if(is_array($brand['ITEMS']) && count($brand['ITEMS']) > 0): ?>
|
||||
<h2 class="catalog_h2_title"><?= $brand['NAME']; ?></h2>
|
||||
<div id="list" class="catalog_list">
|
||||
<? foreach($brand['ITEMS'] AS $arItem): ?>
|
||||
|
||||
@ -12,9 +12,9 @@
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<? if(count($arResult['MODELS']) > 0): ?>
|
||||
<? if(is_array($arResult['MODELS']) && count($arResult['MODELS']) > 0): ?>
|
||||
<? foreach($arResult['MODELS'] AS $model): ?>
|
||||
<? if(count($model['ITEMS']) > 0): ?>
|
||||
<? if(is_array($model['ITEMS']) && count($model['ITEMS']) > 0): ?>
|
||||
<h2 class="catalog_h2_title"><?= $arParams['BRAND_NAME']; ?> <?= $model['NAME']; ?></h2>
|
||||
<div id="list" class="catalog_list">
|
||||
<? foreach($model['ITEMS'] AS $arItem): ?>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<? if(count($arResult['MODELS']) > 0): ?>
|
||||
<? if(is_array($arResult['MODELS']) && count($arResult['MODELS']) > 0): ?>
|
||||
<div class="recom_models">
|
||||
<div class="title_wrapper">
|
||||
<p class="title">Рекомендуемые модели <?= $arParams['BRAND_NAME']; ?> для Вас</p>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<? if(count($arResult['ITEMS']) > 0): ?>
|
||||
<? if(is_array($arResult['ITEMS']) && count($arResult['ITEMS']) > 0): ?>
|
||||
<h2 class="catalog_h2_title <?= $arParams['EXTENDED'] ? "" : ""; ?>" id="catalog_special_h2">Спецпредложения</h2>
|
||||
<div id="list" class="catalog_list">
|
||||
<? foreach($arResult['ITEMS'] AS $arItem): ?>
|
||||
|
||||
@ -29,7 +29,7 @@ $this->setFrameMode(true);
|
||||
</section>
|
||||
|
||||
<div class="clear"></div>
|
||||
<? if(count($arResult['PROPERTIES']['OFFERS']['~VALUE']) > 0): ?>
|
||||
<? if(is_array($arResult['PROPERTIES']['OFFERS']['~VALUE']) && count($arResult['PROPERTIES']['OFFERS']['~VALUE']) > 0): ?>
|
||||
<section class="gray">
|
||||
<div class="container">
|
||||
<h2>Лизинговые предложения</h2>
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
<?
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
|
||||
$arTemplateDescription = array(
|
||||
"NAME" => GetMessage("DEFAULT_NAME"),
|
||||
"DESCRIPTION" => GetMessage("DEFAULT_DESC"),
|
||||
);
|
||||
?>
|
||||
@ -0,0 +1,73 @@
|
||||
<?
|
||||
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;
|
||||
|
||||
if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$arResult = array();
|
||||
$sort = Array("NAME" => "ASC");
|
||||
// if($arParams['CODE'] ===)
|
||||
$filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => 3, "CODE" => $arParams['CODE']);
|
||||
$options = Array("nPageSize" => 1000);
|
||||
|
||||
if(isset($arParams["sort"]))
|
||||
{
|
||||
$sort = $arParams["sort"];
|
||||
}
|
||||
|
||||
if(isset($arParams["options"]))
|
||||
{
|
||||
$options = $arParams["options"];
|
||||
}
|
||||
|
||||
if(isset($arParams["filter"]))
|
||||
{
|
||||
$filter = array_merge($filter, $arParams["filter"]);
|
||||
}
|
||||
|
||||
$res = CIBlockElement::GetList($sort, $filter, false, $options);
|
||||
$arResult = Array();
|
||||
|
||||
while ($obElement = $res->GetNextElement())
|
||||
{
|
||||
$ar_res = $obElement->GetFields();
|
||||
$ar_res['PROPERTIES'] = $obElement->GetProperties();
|
||||
|
||||
if(isset($ar_res['DETAIL_PICTURE']))
|
||||
{
|
||||
$ar_res['DETAIL_PICTURE'] = CFile::GetPath($ar_res['DETAIL_PICTURE']);
|
||||
}
|
||||
|
||||
$arResult = $ar_res;
|
||||
}
|
||||
|
||||
if(empty($ar_res['NAME'])) { define('ERROR_404', 'Y'); }
|
||||
else
|
||||
{
|
||||
$APPLICATION->AddChainItem($ar_res["NAME"]);
|
||||
|
||||
$APPLICATION->SetPageProperty("title", $arParams['TITLE']);
|
||||
$APPLICATION->SetPageProperty("description", $arParams['DESCRIPTION']);
|
||||
$APPLICATION->SetPageProperty("keywords", $arParams['KEYWORDS']);
|
||||
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="'.$ar_res['CANONICAL_PAGE_URL'].'"/>');
|
||||
}
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$MESS ['DEFAULT_NAME'] = "Список баннеров в специальных приложениях";
|
||||
$MESS ['DEFAULT_DESC'] = "Список баннеров в специальных приложениях";
|
||||
?>
|
||||
@ -0,0 +1,81 @@
|
||||
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @global CMain $APPLICATION */
|
||||
/** @global CUser $USER */
|
||||
/** @global CDatabase $DB */
|
||||
/** @var CBitrixComponentTemplate $this */
|
||||
/** @var string $templateName */
|
||||
/** @var string $templateFile */
|
||||
/** @var string $templateFolder */
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<section data-page="leasing_special">
|
||||
<div class="container">
|
||||
<h1 class="section_title"><?= $arResult['NAME']; ?></h1>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:programs.offers.banners",
|
||||
"",
|
||||
Array(
|
||||
"BANNERS" => $arResult['PROPERTIES']['SPECIAL_OFFERS_BANNERS']['VALUE'],
|
||||
"PAGINATION" => "N",
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="clear"></div>
|
||||
<? if(is_array($arResult['PROPERTIES']['OFFERS']['~VALUE']) && count($arResult['PROPERTIES']['OFFERS']['~VALUE']) > 0): ?>
|
||||
<section class="gray">
|
||||
<div class="container">
|
||||
<h2>Лизинговые предложения</h2>
|
||||
<div class="leasing_offers_list">
|
||||
<? foreach($arResult['PROPERTIES']['OFFERS']['~VALUE'] AS $OFFER): ?>
|
||||
<div class="offer_item">
|
||||
<?= $OFFER['TEXT']; ?>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<? endif; ?>
|
||||
<? if($arResult['PROPERTIES']['CATALOG']['VALUE_XML_ID'] != ""): ?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.program",
|
||||
isset($_REQUEST['ajax']) ? "ajax" : "",
|
||||
array(
|
||||
"PAGINATION" => "Y",
|
||||
"leasing_program" => $arResult['PROPERTIES']['CATALOG']['VALUE_XML_ID'],
|
||||
//"section_code" => $arResult['DETAIL_PAGE_URL'],
|
||||
"top_banners" => false,
|
||||
"FILTER_SMALL" => [ "PROPERTY_TAXI_VALUE" => "Да" ],
|
||||
"BRAND" => $_REQUEST['BRAND'],
|
||||
"MODEL" => $_REQUEST['MODEL'],
|
||||
"MODIFICATION" => $_REQUEST['MODIFICATION'],
|
||||
"DRIVE" => $_REQUEST['DRIVE'],
|
||||
"BODY" => $_REQUEST['BODY'],
|
||||
"GEAR" => $_REQUEST['GEAR'],
|
||||
"ENGINE_FUEL" => $_REQUEST['ENGINE_FUEL'],
|
||||
"ENGINE_POWER_FROM" => $_REQUEST['ENGINE_POWER_FROM'],
|
||||
"ENGINE_POWER_TO" => $_REQUEST['ENGINE_POWER_TO'],
|
||||
"ENGINE_VOLUME_FROM" => $_REQUEST['ENGINE_VOLUME_FROM'],
|
||||
"ENGINE_VOLUME_TO" => $_REQUEST['ENGINE_VOLUME_TO'],
|
||||
"SORT" => $_REQUEST['SORT'],
|
||||
"PATH" => $arResult['DETAIL_PAGE_URL'],
|
||||
"PROGRAM" => $arResult['PROPERTIES']['CATALOG']['VALUE_XML_ID'],
|
||||
)
|
||||
);
|
||||
?>
|
||||
<? endif; ?>
|
||||
<?
|
||||
// $APPLICATION->IncludeComponent(
|
||||
// "evolution:programs.offers",
|
||||
// "",
|
||||
// Array()
|
||||
// );
|
||||
?>
|
||||
@ -38,7 +38,7 @@ $this->setFrameMode(true);
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
|
||||
<? if(count($arResult['BANNERS']) > 2): ?>
|
||||
<? if(is_array($arResult['BANNERS']) && count($arResult['BANNERS']) > 2): ?>
|
||||
<div class="special_arrows">
|
||||
<button class="prev">
|
||||
<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="https://www.w3.org/2000/svg">
|
||||
@ -53,7 +53,7 @@ $this->setFrameMode(true);
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
<? if(count($arResult['BANNERS']) == 0): ?>
|
||||
<? if(is_array($arResult['BANNERS']) && count($arResult['BANNERS']) == 0): ?>
|
||||
<div class="disable_space">
|
||||
<? endif; ?>
|
||||
</div>
|
||||
@ -51,7 +51,7 @@ $this->setFrameMode(true);
|
||||
<?= isset($arResult['PROPERTIES']['CONTENT_TOP']['~VALUE']['TEXT']) ? $arResult['PROPERTIES']['CONTENT_TOP']['~VALUE']['TEXT'] : ""; ?>
|
||||
</div>
|
||||
<div class="leasing_offer">
|
||||
<? if(!is_null($arResult['PROPERTIES']['CARS']['RELATED']) && count($arResult['PROPERTIES']['CARS']['RELATED']) > 0): ?>
|
||||
<? if(!is_null($arResult['PROPERTIES']['CARS']['RELATED']) && is_array($arResult['PROPERTIES']['CARS']['RELATED']) && count($arResult['PROPERTIES']['CARS']['RELATED']) > 0): ?>
|
||||
<div class="title_wrapper">
|
||||
<div class="left">
|
||||
<h3>Лизинговые предложения</h3>
|
||||
|
||||
@ -66,7 +66,7 @@ $this->setFrameMode(true);
|
||||
]); ?>'/>
|
||||
<input type="hidden" id="contract" value="<?= $arResult['CODE']; ?>"/>
|
||||
<div id="photo_480_wrapper">
|
||||
<? if(count($arResult['PHOTOS_480']) > 0): ?>
|
||||
<? if(is_array($arResult['PHOTOS_480']) && count($arResult['PHOTOS_480']) > 0): ?>
|
||||
<img id="photo_480" data-p1080="<?= !empty($arResult['PHOTOS_1080'][0]) ? $arResult['PHOTOS_1080'][0] : ""; ?>" src="<?= !empty($arResult['PHOTOS_480'][0]) ? $arResult['PHOTOS_480'][0] : "/images/no_image_650.png"; ?>" alt="<?= $arResult['NAME']; ?>" width="100%" height="auto" style="opacity:0.0; display: block;">
|
||||
<? if(count($arResult['PHOTOS_480']) > 0): ?>
|
||||
<? foreach($arResult['PHOTOS_480'] AS $k => $photo_480): ?>
|
||||
|
||||
@ -137,7 +137,7 @@ if(!empty($arResult['SUBTITLE']))
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
<? if(count($arResult['ITEMS']) > 0): ?>
|
||||
<? if(is_array($arResult['ITEMS']) && count($arResult['ITEMS']) > 0): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.sort",
|
||||
"",
|
||||
@ -153,7 +153,7 @@ if(!empty($arResult['SUBTITLE']))
|
||||
</div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<? if(count($arResult['ITEMS']) > 0): ?>
|
||||
<? if(is_array($arResult['ITEMS']) && count($arResult['ITEMS']) > 0): ?>
|
||||
<div class="catalog_list" id="catalog_positions_list">
|
||||
<? foreach($arResult['ITEMS'] AS $arItem): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user