From 43d3f83e7f38db3ccab073ca63bfe5671bf2e096 Mon Sep 17 00:00:00 2001 From: merelendor Date: Sun, 12 Jan 2025 15:12:27 +0300 Subject: [PATCH 1/5] sitemap aggregation programms fixes --- local/ilsa_update.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/local/ilsa_update.php b/local/ilsa_update.php index 7c4e2bb..a00bbae 100644 --- a/local/ilsa_update.php +++ b/local/ilsa_update.php @@ -2632,7 +2632,7 @@ if(!in_array("simulate", $GLOBALS['argv'])) while($sitemap_program_aggregations_brand_ob = $sitemap_program_aggregations_brands->GetNextElement()) { $sitemap_program_aggregations_brand = $sitemap_program_aggregations_brand_ob->GetFields(); - $sitemap_program_aggregations_string .= "".$url."/".$program['ROOT_CHUNK']."/".$sitemap_program_aggregations_brand['CODE']."/"."".$lastmod.""."\n"; + $sitemap_program_aggregations_string .= "".$url."/".$program['ROOT_CHUNK']."/brand-".$sitemap_program_aggregations_brand['CODE']."/"."".$lastmod.""."\n"; $sitemap_program_aggregations_brand_types = CIBlockElement::GetList([ "NAME" => "ASC" ], [ "IBLOCK_ID" => $program['RULES_ID'], "PROPERTY_VEHICLE_BRAND" => $sitemap_program_aggregations_brand['ID'], "ACTIVE" => "Y" ], false, [ "nTopCount" => 1000 ], [], ); while($sitemap_program_aggregations_type_ob = $sitemap_program_aggregations_brand_types->GetNextElement()) @@ -2643,11 +2643,12 @@ if(!in_array("simulate", $GLOBALS['argv'])) if(!empty($sitemap_program_aggregations_brand_type['PROPERTIES']['VEHICLE_TYPE']['VALUE'])) { $sitemap_program_aggregations_brand_type_related = get_related($program['ROOT_ID'], $sitemap_program_aggregations_brand_type['PROPERTIES']['VEHICLE_TYPE']['VALUE']); - $sitemap_program_aggregations_string .= "".$url."/".$program['ROOT_CHUNK']."/".$sitemap_program_aggregations_brand['CODE']."/".$sitemap_program_aggregations_brand_type_related['CODE']."/"."".$lastmod.""."\n"; + $sitemap_program_aggregations_string .= "".$url."/".$program['ROOT_CHUNK']."/brand-".$sitemap_program_aggregations_brand['CODE']."/".$sitemap_program_aggregations_brand_type_related['CODE']."/"."".$lastmod.""."\n"; } } } } + $sitemap_program_aggregations_string .= ""."\n"; file_put_contents($_SERVER['DOCUMENT_ROOT']."/sitemap-programs.xml", $sitemap_program_aggregations_string); From f596597822a41828a5fae5ea799a0f765f2c42be Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 4 Feb 2025 15:42:18 +0300 Subject: [PATCH 2/5] USED api parameters fix for PTS and RESTRICTIONS keys --- api/index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/api/index.php b/api/index.php index aabd8da..b858ee1 100644 --- a/api/index.php +++ b/api/index.php @@ -1602,7 +1602,10 @@ switch($PARAM_1) $restrictions_values = array_unique($restrictions_values); foreach($restrictions_values AS $rv) { - array_push($restrictions, $flags['RESTRICTIONS'][ $rv ]); + if($flags['RESTRICTIONS'][ $rv ] !== null && $flags['RESTRICTIONS'][ $rv ] !== "") + { + array_push($restrictions, $flags['RESTRICTIONS'][ $rv ]); + } } //filter for pts @@ -1618,7 +1621,10 @@ switch($PARAM_1) $pts_values = array_unique($pts_values); foreach($pts_values AS $rp) { - array_push($pts, $flags['PTS'][ $rp ]); + if($flags['PTS'][ $rp ] !== null && $flags['PTS'][ $rp ] !== "") + { + array_push($pts, $flags['PTS'][ $rp ]); + } } //filter for reserved From 5bcaf35c0c666a98608e1b08158707445bc107e1 Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 4 Feb 2025 15:44:28 +0300 Subject: [PATCH 3/5] update for CALCULATION logic --- .../components/evolution/catalog.promo.brand/component.php | 4 ++-- .../components/evolution/catalog.promo.model/component.php | 4 ++-- local/components/evolution/catalog/component.php | 4 ++-- local/components/evolution/used.catalog/component.php | 7 +++++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/local/components/evolution/catalog.promo.brand/component.php b/local/components/evolution/catalog.promo.brand/component.php index bf52df2..a4879b0 100644 --- a/local/components/evolution/catalog.promo.brand/component.php +++ b/local/components/evolution/catalog.promo.brand/component.php @@ -56,8 +56,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $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, ".", " "); + $ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE']*0.55 + $ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT * 58)*SAVINGS_TAX_COEFFICIENT/1.2), 0, ".", " "); + $ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE']*0.55 + $ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT * 58)*SAVINGS_VAT_COEFFICIENT/1.2), 0, ".", " "); $brands_ar_res['ITEMS'][] = $ar_res; } diff --git a/local/components/evolution/catalog.promo.model/component.php b/local/components/evolution/catalog.promo.model/component.php index 5c9a571..1acdb8a 100644 --- a/local/components/evolution/catalog.promo.model/component.php +++ b/local/components/evolution/catalog.promo.model/component.php @@ -51,8 +51,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $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, ".", " "); + $ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE']*0.55 + $ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT * 58)*SAVINGS_TAX_COEFFICIENT/1.2), 0, ".", " "); + $ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE']*0.55 + $ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT * 58)*SAVINGS_VAT_COEFFICIENT/1.2), 0, ".", " "); $models_ar_res['ITEMS'][] = $ar_res; } diff --git a/local/components/evolution/catalog/component.php b/local/components/evolution/catalog/component.php index 6da0b4f..61bac81 100644 --- a/local/components/evolution/catalog/component.php +++ b/local/components/evolution/catalog/component.php @@ -365,8 +365,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $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, ".", " "); + $ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE']*0.55 + $ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT * 58)*SAVINGS_TAX_COEFFICIENT/1.2), 0, ".", " "); + $ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE']*0.55 + $ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT * 58)*SAVINGS_VAT_COEFFICIENT/1.2), 0, ".", " "); $arResult['ITEMS'][] = $ar_res; } diff --git a/local/components/evolution/used.catalog/component.php b/local/components/evolution/used.catalog/component.php index 6166818..915cca8 100644 --- a/local/components/evolution/used.catalog/component.php +++ b/local/components/evolution/used.catalog/component.php @@ -482,8 +482,11 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true)))) $ar_res['CALCULATION'] = []; $ar_res['CALCULATION']['MONTHLY'] = number_format(($price / CALCULATION_COEFFICIENT), 0, ".", " "); //$ar_res['CALCULATION']['MONTHLY'] = number_format((($price / 100) * 10), 0, ".", " "); - $ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($price / 100) * 4), 0, ".", " "); - $ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($price / 100) * 4), 0, ".", " "); + //$ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($price / 100) * 4), 0, ".", " "); + //$ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($price / 100) * 4), 0, ".", " "); + + $ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($price*0.55 + $price / CALCULATION_COEFFICIENT * 58)*SAVINGS_TAX_COEFFICIENT/1.2), 0, ".", " "); + $ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($price*0.55 + $price / CALCULATION_COEFFICIENT * 58)*SAVINGS_VAT_COEFFICIENT/1.2), 0, ".", " "); $ar_res['PREVIEW_PICTURE'] = CFile::GetPath($ar_res['PROPERTIES']['PHOTO']['VALUE']); From c4b6e8cb7dd81ecf197a657c75314248e61c14d5 Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 4 Feb 2025 15:45:15 +0300 Subject: [PATCH 4/5] update for displaying russian rouble symbol --- .../catalog.list.item/templates/.default/template.php | 8 ++++---- .../catalog.promo.brand/templates/.default/template.php | 8 ++++---- .../catalog.promo.model/templates/.default/template.php | 8 ++++---- .../templates/.default/template.php | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/local/components/evolution/catalog.list.item/templates/.default/template.php b/local/components/evolution/catalog.list.item/templates/.default/template.php index 43541f6..1dd7709 100644 --- a/local/components/evolution/catalog.list.item/templates/.default/template.php +++ b/local/components/evolution/catalog.list.item/templates/.default/template.php @@ -24,19 +24,19 @@ $this->setFrameMode(true);
  • Ежемесячный платёж (от)

    -

    р.

    +

  • Стоимость автомобиля (от)

    -

    р.

    +

  • Экономия по налогу на прибыль (до)

    -

    р.

    +

  • НДС к возмещению из бюджета (до)

    -

    р.

    +