From ece13a9f91c37a84bb994e509c75b8e9f2cb8fc0 Mon Sep 17 00:00:00 2001 From: merelendor Date: Fri, 23 Aug 2024 11:00:52 +0300 Subject: [PATCH] aggregation page fix: titles, correct stript tags for checking --- .../programs.aggregations/component.php | 17 +++++++++++------ .../templates/.default/template.php | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/local/components/evolution/programs.aggregations/component.php b/local/components/evolution/programs.aggregations/component.php index 38daae2..cc981f0 100644 --- a/local/components/evolution/programs.aggregations/component.php +++ b/local/components/evolution/programs.aggregations/component.php @@ -38,6 +38,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $type_name = null; $type_plural = null; $type_genitive = null; + $type_accusative = null; + $type_singular_genitive = null; $type_slug = null; $type_section = null; @@ -47,7 +49,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $res_group = CIBlockSection::GetList( [ "SORT" => "ASC" ], [ "ACTIVE" => "Y", "IBLOCK_ID" => $arParams['IBLOCK_ID_PROGRAMS_AGGREGATION'], "CODE" => $_REQUEST['GROUP'], ], - false, [ "UF_VEHICLE_GROUP_GENITIVE_NAME", "UF_VEHICLE_GROUP_ACCUSATIVE_NAME", "UF_VEHICLE_GROUP_PREPOSITIONAL_NAME", ] + false, [ "UF_VEHICLE_GROUP_GENITIVE_NAME", "UF_VEHICLE_GROUP_ACCUSATIVE_NAME", "UF_VEHICLE_GROUP_PREPOSITIONAL_NAME", "UF_VEHICLE_GROUP_NAME_GENDER", ] ); while($section_group = $res_group->GetNext()) @@ -57,6 +59,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $group_genitive = $section_group['UF_VEHICLE_GROUP_GENITIVE_NAME']; $group_accusative = $section_group['UF_VEHICLE_GROUP_ACCUSATIVE_NAME']; $group_prepositional = $section_group['UF_VEHICLE_GROUP_PREPOSITIONAL_NAME']; + $group_gender = UF_VEHICLE_GROUP_NAME_GENDER_IDS[$section_group['UF_VEHICLE_GROUP_NAME_GENDER']]; $group_slug = $section_group['CODE']; //$section_group['PROPERTIES'] = $section_group; @@ -103,6 +106,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $type_name = $ar_res_type['NAME']; $type_plural = $ar_res_type['PROPERTIES']['PLURAL_NAME']['VALUE']; $type_genitive = $ar_res_type['PROPERTIES']['GENITIVE_NAME']['VALUE']; + $type_accusative = $ar_res_type['PROPERTIES']['ACCUSATIVE_NAME']['VALUE']; $type_singular_genitive = $ar_res_type['PROPERTIES']['GENITIVE_SINGULAR_NAME']['VALUE']; $type_slug = $ar_res_type['CODE']; $type_gender = $ar_res_type['PROPERTIES']['NAME_GENDER']['VALUE_XML_ID']; @@ -209,6 +213,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $arResult['GROUP_GENITIVE'] = $group_genitive; $arResult['GROUP_ACCUSATIVE'] = $group_accusative; $arResult['GROUP_PREPOSITIONAL'] = $group_prepositional; + $arResult['GROUP_GENDER'] = $group_gender; $arResult['BRAND'] = $brand; $arResult['BRAND_NAME'] = $brand_name; @@ -231,16 +236,16 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) { if($group !== null) { - $APPLICATION->SetPageProperty("title", "".$group_name." в лизинг для юридических лиц и ИП в Москве - купить новую ".mb_strtolower($group_accusative)." в лизинг | Эволюция"); - $APPLICATION->SetPageProperty("description", "Новая ".mb_strtolower($group_name)." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".mb_strtolower($group_accusative)." в лизинг от официальных дилеров на выгодных условиях со скидкой. Телефон горячей линии 8 (800) 333-75-75 - звонок по России бесплатный."); + $APPLICATION->SetPageProperty("title", "".$group_name." в лизинг для юридических лиц и ИП в Москве - купить ".($group_gender === "M" ? "новый" : ($group_gender === "F" ? "новую" : "новые" ))." ".mb_strtolower($group_accusative)." в лизинг | Эволюция"); + $APPLICATION->SetPageProperty("description", "".($group_gender === "M" ? "Новый" : ($group_gender === "F" ? "Новая" : "Новые" ))." ".mb_strtolower($group_name)." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".mb_strtolower($group_accusative)." в лизинг от официальных дилеров на выгодных условиях со скидкой. Телефон горячей линии 8 (800) 333-75-75 - звонок по России бесплатный."); $APPLICATION->SetPageProperty("keywords", "".mb_strtolower($group_name)." в лизинг, купить ".mb_strtolower($group_accusative)." в лизинг, ".mb_strtolower($group_name)." в лизинг для юридических лиц, ".mb_strtolower($group_name)." в лизинг для ип"); $APPLICATION->AddChainItem($group_name, "/programs/special/".$group_slug."/"); if($type !== null) { - $APPLICATION->SetPageProperty("title", "".$type_plural." в лизинг для юридических лиц и ИП в Москве - купить ".($type_gender === "M" ? "новый" : ($type_gender === "F" ? "новую" : "новые" ))." ".$type_name." в лизинг | Эволюция"); - $APPLICATION->SetPageProperty("description", "Новые ".mb_strtolower($type_plural)." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".$type_name." в лизинг от официальных дилеров на выгодных условиях со скидкой. Телефон горячей линии 8 (800) 333-75-75 - звонок по России бесплатный."); - $APPLICATION->SetPageProperty("keywords", "".$type_plural." в лизинг, купить ".$type_name." в лизинг, ".$type_name." в лизинг для юридических лиц, ".$type_name." в лизинг для ип"); + $APPLICATION->SetPageProperty("title", "".$type_plural." в лизинг для юридических лиц и ИП в Москве - купить ".($type_gender === "M" ? "новый" : ($type_gender === "F" ? "новую" : "новые" ))." ".mb_strtolower($type_accusative)." в лизинг | Эволюция"); + $APPLICATION->SetPageProperty("description", "".($type_gender === "M" ? "Новые" : ($type_gender === "F" ? "Новая" : "Новое" ))." ".mb_strtolower($type_plural)." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".mb_strtolower($type_accusative)." в лизинг от официальных дилеров на выгодных условиях со скидкой. Телефон горячей линии 8 (800) 333-75-75 - звонок по России бесплатный."); + $APPLICATION->SetPageProperty("keywords", "".mb_strtolower($type_plural)." в лизинг, купить ".mb_strtolower($type_accusative)." в лизинг, ".mb_strtolower($type_name)." в лизинг для юридических лиц, ".mb_strtolower($type_name)." в лизинг для ип"); $APPLICATION->AddChainItem($type_name, "/programs/special/".$group_slug."/".$type_slug."/"); } diff --git a/local/components/evolution/programs.aggregations/templates/.default/template.php b/local/components/evolution/programs.aggregations/templates/.default/template.php index 87944fb..50e7cbe 100644 --- a/local/components/evolution/programs.aggregations/templates/.default/template.php +++ b/local/components/evolution/programs.aggregations/templates/.default/template.php @@ -412,7 +412,7 @@ elseif(isset($arResult['GROUP'])) ); ?> - +