diff --git a/local/components/evolution/catalog/component.php b/local/components/evolution/catalog/component.php index 5162b25..b507ce6 100644 --- a/local/components/evolution/catalog/component.php +++ b/local/components/evolution/catalog/component.php @@ -54,18 +54,29 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $arResult['SELECTED']['SORT'] = $arParams['SORT']; } - $filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => 1); + $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'] = true; + $arResult['MODEL_DISABLED'] = true; $arResult['EXTENDED'] = false; $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"], ["ACTIVE" => "Y", "IBLOCK_ID" => 8, "CODE" => $arParams['BRAND']], false, []); + $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(); @@ -79,6 +90,20 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $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['SHOW_MODELS_LIST'] = false; + } + + $arResult['SHOW_PROMO_BRANDS'] = false; + $APPLICATION->AddChainItem($brands_ar_res['NAME'], "https://".SITE_SERVER_NAME."/catalog/".$arResult['SELECTED']['BRAND']."/"); } @@ -94,7 +119,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) if(!empty($arParams['MODEL'])) { - $models_res = CIBlockElement::GetList(["NAME" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => 9, "CODE" => $arParams['MODEL']], false, []); + $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(); @@ -103,6 +128,17 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $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; + } + $APPLICATION->AddChainItem($models_ar_res['NAME'], "https://".SITE_SERVER_NAME."/catalog/".$arResult['SELECTED']['BRAND']."/".$arResult['SELECTED']['MODEL']."/"); } @@ -294,71 +330,102 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $filter['PROPERTY_LEASING_PROGRAMS'] = $arParams["leasing_program"]; } - if(empty($arParams['PROGRAM'])) - { - $arResult['SHOW_SPECIAL_OFFERS'] = true; - $arResult['SHOW_PROMO_BRANDS'] = true; - } - if(!empty($arParams['BRAND'])) { - $arResult['SHOW_PROMO_BRANDS'] = false; + $arResult['SHOW_PROMO_BRANDS'] = true; + + 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['SHOW_BRANDS_LIST'] = false; + $arResult['SHOW_MODELS_LIST'] = false; + $arResult['BRAND_DISABLED'] = false; + $arResult['MODEL_DISABLED'] = false; } if(!empty($arParams['MODEL']) || !empty($arParams['PROGRAM']) || $arResult['BY_OPTIONS']) { - $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()) + if(!$arResult['BRAND_DISABLED'] && !$arResult['MODEL_DISABLED']) { - $ar_res = $obElement->GetFields(); - $ar_res['PROPERTIES'] = $obElement->GetProperties(); - $ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(8, $ar_res['PROPERTIES']['BRAND']['VALUE']); - $ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(9, $ar_res['PROPERTIES']['MODEL']['VALUE']); - $ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(10, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']); + $arResult['SHOW_SPECIAL_OFFERS'] = false; + $arResult['SHOW_PROMO_BRANDS'] = false; + $arResult['SHOW_PROMO_MODELS'] = false; - $ar_res['CALCULATION'] = []; - $ar_res['CALCULATION']['MONTHLY'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 10), 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, ".", " "); + $res = CIBlockElement::GetList($sort, $filter, false, $options); - //print "\n"; - //print "\n\n\n"; - - /* - if(isset($ar_res['PREVIEW_PICTURE'])) + while ($obElement = $res->GetNextElement()) { - $ar_res['PREVIEW_PICTURE_SRC'] = get_image_path($ar_res['PREVIEW_PICTURE']); - } + $ar_res = $obElement->GetFields(); + $ar_res['PROPERTIES'] = $obElement->GetProperties(); + $ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(8, $ar_res['PROPERTIES']['BRAND']['VALUE']); + $ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(9, $ar_res['PROPERTIES']['MODEL']['VALUE']); + $ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(10, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']); - if(!empty($ar_res['PROPERTIES']['PHOTO_ICON']['VALUE'])) - { - $ar_res['PROPERTIES']['PHOTO_ICON']['SRC'] = get_image_path($ar_res['PROPERTIES']['PHOTO_ICON']['VALUE']); - } + $ar_res['CALCULATION'] = []; + $ar_res['CALCULATION']['MONTHLY'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 10), 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, ".", " "); - if(!empty($ar_res['PROPERTIES']['CITY']['VALUE'])) - { - $ar_res['PROPERTIES']['CITY']['RELATED'] = get_related_array(10, $ar_res['PROPERTIES']['CITY']['VALUE']); - } + //print "\n"; + //print "\n\n\n"; - if(!empty($ar_res['PROPERTIES']['SUBWAY']['VALUE'])) - { - $ar_res['PROPERTIES']['SUBWAY']['RELATED'] = get_related_array(12, $ar_res['PROPERTIES']['SUBWAY']['VALUE']); - } - */ + /* + if(isset($ar_res['PREVIEW_PICTURE'])) + { + $ar_res['PREVIEW_PICTURE_SRC'] = get_image_path($ar_res['PREVIEW_PICTURE']); + } - $arResult['ITEMS'][] = $ar_res; + if(!empty($ar_res['PROPERTIES']['PHOTO_ICON']['VALUE'])) + { + $ar_res['PROPERTIES']['PHOTO_ICON']['SRC'] = get_image_path($ar_res['PROPERTIES']['PHOTO_ICON']['VALUE']); + } + + if(!empty($ar_res['PROPERTIES']['CITY']['VALUE'])) + { + $ar_res['PROPERTIES']['CITY']['RELATED'] = get_related_array(10, $ar_res['PROPERTIES']['CITY']['VALUE']); + } + + if(!empty($ar_res['PROPERTIES']['SUBWAY']['VALUE'])) + { + $ar_res['PROPERTIES']['SUBWAY']['RELATED'] = get_related_array(12, $ar_res['PROPERTIES']['SUBWAY']['VALUE']); + } + */ + + $arResult['ITEMS'][] = $ar_res; + } } } @@ -402,6 +469,24 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $arResult['PAGE_CURRENT'] = $res->NavPageNomer; $arResult['PAGE_COUNT'] = $res->NavPageCount; + 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; + } + if(isset($_REQUEST['ajax'])) { $GLOBALS['APPLICATION']->RestartBuffer(); diff --git a/local/components/evolution/catalog/templates/.default/template.php b/local/components/evolution/catalog/templates/.default/template.php index ba8ec6b..a46bbf0 100644 --- a/local/components/evolution/catalog/templates/.default/template.php +++ b/local/components/evolution/catalog/templates/.default/template.php @@ -106,6 +106,15 @@ if(!empty($arResult['TITLES']['MODEL'])) + +

Автомобили на данный момент отсутствуют в каталоге, но это не означает, что мы не сможем их для Вас найти. Оставьте заявку или позвоните по номеру горячей линии 8 800 333 75 75 и мы найдём Вам автомобиль!

+

Посмотрите автомобили других марок:

+ + +

Модель на данный момент отсутствует в каталоге, но это не означает, что мы не сможем её для Вас найти. Оставьте заявку или позвоните по номеру горячей линии 8 800 333 75 75 и мы найдём Вам автомобиль!

+

Посмотрите другие модели Bentley:

+ + IncludeComponent( @@ -225,7 +234,7 @@ if(!empty($arResult['TITLES']['MODEL'])) */ ?> - + IncludeComponent( "evolution:catalog.brands", "", @@ -236,7 +245,7 @@ if(!empty($arResult['TITLES']['MODEL'])) ) ); ?> - + IncludeComponent( "evolution:catalog.models", "", diff --git a/local/components/evolution/form.catalog.filter/templates/.default/script.js b/local/components/evolution/form.catalog.filter/templates/.default/script.js index be3c694..590cc08 100644 --- a/local/components/evolution/form.catalog.filter/templates/.default/script.js +++ b/local/components/evolution/form.catalog.filter/templates/.default/script.js @@ -10,7 +10,7 @@ var total = undefined; function formCatalogFilter(p, pr, props) { - console.log("FILTER", "program", pr); +// console.log("FILTER", "program", pr); path = p; selected = props; current_params = props; @@ -27,7 +27,7 @@ function updateCounter(parameters, reset = false) { $(".catalog_filter_select").attr("disabled", true); - console.log("updateCounter", "parameters (selected)", parameters); +// console.log("updateCounter", "parameters (selected)", parameters); if(!updating) { @@ -63,23 +63,28 @@ function updateCounter(parameters, reset = false) var current = $("#filter_brands").val(); $("#filter_brands").empty(); + $("#small_filter_brands").empty(); if(!reset && current !== "" && current !== null) { $("#filter_brands").append(''); + $("#small_filter_brands").append(''); } else { $("#filter_brands").append(''); + $("#small_filter_brands").append(''); } for(let i in response.brands) { var brand = response.brands[i]; $("#filter_brands").append(''); + $("#small_filter_brands").append(''); } $("#filter_brands").val(reset ? "" : current); + $("#small_filter_brands").val(reset ? "" : current); } } @@ -88,23 +93,28 @@ function updateCounter(parameters, reset = false) var current = $("#filter_models").val(); $("#filter_models").empty(); + $("#small_filter_models").empty(); if(!reset && current !== "" && current !== null) { $("#filter_models").append(''); + $("#small_filter_models").append(''); } else { $("#filter_models").append(''); + $("#small_filter_models").append(''); } for(let i in response.models) { var model = response.models[i]; $("#filter_models").append(''); + $("#small_filter_models").append(''); } $("#filter_models").val(reset ? "" : current); + $("#small_filter_models").val(reset ? "" : current); } if(response.modifications !== undefined) @@ -133,11 +143,9 @@ function updateCounter(parameters, reset = false) if(response.bodies !== undefined) { - console.log("BODY FROM RESPONSE"); if(response.bodies.length > 0) { var current = $("#filter_bodies").val(); - console.log("BODY FROM RESPONSE", "current", current); $("#filter_bodies").empty(); if(!reset && current !== "" && current !== null) @@ -387,7 +395,7 @@ function updateCounter(parameters, reset = false) function loadModels(uid) { - console.log("loadModels()", "uid", uid); +// console.log("loadModels()", "uid", uid); $.post("/api/catalog/models/", { @@ -447,7 +455,7 @@ function loadModels(uid) function loadModifications(uid) { - console.log("loadModifications", uid); +// console.log("loadModifications", uid); $.post("/api/catalog/modifications/", { MODEL_UID: uid @@ -494,7 +502,7 @@ $(function() params: {}, }, function(response) { - console.log("selected", selected); +// console.log("selected", selected); //$("#small_filter_brands").empty(); //$("#small_filter_brands").find("option").first().text("Любая").attr("disabled", false); //$("#filter_brands").find("option").first().text("Любая").attr("disabled", false); @@ -635,7 +643,9 @@ $(function() $("#filter_modifications").empty(); $("#filter_modifications").append(""); - loadModels(uid); + //console.log("selected", selected); + //loadModels(uid); + updateCounter(selected); } }); @@ -819,8 +829,8 @@ $(function() $(".sort_option").on("click", function() { - console.log("path", path); - console.log("current_params", current_params); +// console.log("path", path); +// console.log("current_params", current_params); var value = $(this).data("value"); var p = path; diff --git a/local/components/evolution/form.leasing/templates/.default/template.php b/local/components/evolution/form.leasing/templates/.default/template.php index e6b8228..849ce47 100644 --- a/local/components/evolution/form.leasing/templates/.default/template.php +++ b/local/components/evolution/form.leasing/templates/.default/template.php @@ -47,6 +47,7 @@ $this->setFrameMode(true); } .send_button_spinner_animation div { box-sizing: content-box; } +

Купить в лизинг?

diff --git a/local/components/evolution/leasing.programs.entry/templates/.default/template.php b/local/components/evolution/leasing.programs.entry/templates/.default/template.php index ebc6f28..eed8989 100644 --- a/local/components/evolution/leasing.programs.entry/templates/.default/template.php +++ b/local/components/evolution/leasing.programs.entry/templates/.default/template.php @@ -47,7 +47,7 @@ $this->setFrameMode(true); IncludeComponent( "evolution:catalog", - "", + isset($_REQUEST['ajax']) ? "ajax" : "", array( "PAGINATION" => "Y", "leasing_program" => $arResult['PROPERTIES']['CATALOG']['VALUE_XML_ID'], diff --git a/local/templates/404/footer.php b/local/templates/404/footer.php index 9465877..a35ee7c 100644 --- a/local/templates/404/footer.php +++ b/local/templates/404/footer.php @@ -53,7 +53,7 @@
-

© ООО "ЛК Эволюция"

+

© ООО "ЛК Эволюция"
г. Москва, Котляковская ул., д. 8

Обработка персональных данных
diff --git a/local/templates/evolution/css/components/style.css b/local/templates/evolution/css/components/style.css index ba77aa9..96f785b 100644 --- a/local/templates/evolution/css/components/style.css +++ b/local/templates/evolution/css/components/style.css @@ -400,6 +400,10 @@ input[type="radio"]:disabled + label:before { } .pagination { margin-top: 40px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; } @media all and (max-width: 1600px) and (min-width: 1280px) { .pagination { @@ -427,6 +431,9 @@ input[type="radio"]:disabled + label:before { padding: 0 5px; } @media all and (max-width: 1279px) { + .pagination { + margin-bottom: 50px; + } .pagination ul { justify-content: center; } @@ -440,6 +447,11 @@ input[type="radio"]:disabled + label:before { font-weight: 600; } } +@media all and (max-width: 768px) { + .pagination { + margin-bottom: 30px; + } +} .image-full { width: 100%; margin-bottom: 50px; diff --git a/local/templates/evolution/css/components/style.less b/local/templates/evolution/css/components/style.less index b9e4560..a7b0299 100644 --- a/local/templates/evolution/css/components/style.less +++ b/local/templates/evolution/css/components/style.less @@ -448,50 +448,61 @@ input[type="radio"] { // Pagination .pagination { - margin-top: 40px; + margin-top: 40px; - @media all and (max-width: 1600px) and (min-width: 1280px) { - margin-top: 20px; - } + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; - ul { - display: flex; - align-items: flex-end; - justify-content: flex-end; + @media all and (max-width: 1600px) and (min-width: 1280px) { + margin-top: 20px; + } - li { - font-size: 26px; - line-height: 35px; - color: var(--blue); + ul { + display: flex; + align-items: flex-end; + justify-content: flex-end; - @media all and (max-width: 1600px) and (min-width: 1280px) { - font-size: 20px; - line-height: 30px; - } + li { + font-size: 26px; + line-height: 35px; + color: var(--blue); - a { - display: block; - padding: 0 5px; - } - } - } + @media all and (max-width: 1600px) and (min-width: 1280px) { + font-size: 20px; + line-height: 30px; + } - @media all and (max-width: 1279px) { - ul { - justify-content: center; + a { + display: block; + padding: 0 5px; + } + } + } - li { - font-size: 13px; - line-height: 28px; - min-width: 30px; + @media all and (max-width: 1279px) { + margin-bottom: 50px; - a { - text-align: center; - font-weight: 600; - } - } - } - } + ul { + justify-content: center; + + li { + font-size: 13px; + line-height: 28px; + min-width: 30px; + + a { + text-align: center; + font-weight: 600; + } + } + } + } + + @media all and (max-width: 768px) { + margin-bottom: 30px; + } } // Превью изображения diff --git a/local/templates/evolution/css/main/style.css b/local/templates/evolution/css/main/style.css index 8f16f18..a166c01 100644 --- a/local/templates/evolution/css/main/style.css +++ b/local/templates/evolution/css/main/style.css @@ -5658,7 +5658,7 @@ main .dropdown_blocks_list .dropdown_block .block_body .transaction_detail ul li justify-content: center; padding: 0px; margin: 0px; - margin-bottom: 100px; + margin-bottom: 50px; width: 100%; background: rgba(0, 16, 61, 0.06); color: var(--blue); @@ -5667,6 +5667,11 @@ main .dropdown_blocks_list .dropdown_block .block_body .transaction_detail ul li margin: 10px; font-weight: 600; } +@media all and (max-width: 768px) { + .catalog_show_more_button { + margin-bottom: 30px; + } +} .catalog_item_with_button { margin-bottom: 40px !important; } diff --git a/local/templates/evolution/css/main/style.less b/local/templates/evolution/css/main/style.less index 53ac2ac..7093c55 100644 --- a/local/templates/evolution/css/main/style.less +++ b/local/templates/evolution/css/main/style.less @@ -6096,7 +6096,7 @@ main .dropdown_blocks_list .dropdown_block .block_body { justify-content: center; padding: 0px; margin: 0px; - margin-bottom: 100px; + margin-bottom: 50px; width: 100%; background: rgba(0, 16, 61, 0.06); color: var(--blue); @@ -6105,6 +6105,10 @@ main .dropdown_blocks_list .dropdown_block .block_body { margin: 10px; font-weight: 600; } + + @media all and (max-width: 768px) { + margin-bottom: 30px; + } } .catalog_item_with_button { diff --git a/local/templates/evolution/footer.php b/local/templates/evolution/footer.php index e571754..66bfeda 100644 --- a/local/templates/evolution/footer.php +++ b/local/templates/evolution/footer.php @@ -67,7 +67,7 @@ -

© ООО "ЛК Эволюция"

+

© ООО "ЛК Эволюция"
г. Москва, Котляковская ул., д. 8

Обработка персональных данных