used catalog
This commit is contained in:
parent
00617255cb
commit
de786c4248
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,9 +1,10 @@
|
||||
bitrix/*
|
||||
!bitrix/php_interface/classes/*
|
||||
!bitrix/php_interface/init.php
|
||||
upload/
|
||||
google*
|
||||
robots.txt
|
||||
sitemap*
|
||||
sitemap*.xml
|
||||
.xml
|
||||
.htsecure
|
||||
cron/yasprav.log
|
||||
|
||||
@ -14,6 +14,13 @@ $aMenuLinks = Array(
|
||||
Array(),
|
||||
""
|
||||
),
|
||||
Array(
|
||||
"С пробегом",
|
||||
"/used/",
|
||||
Array(),
|
||||
Array(),
|
||||
""
|
||||
),
|
||||
Array(
|
||||
"Спецпредложения",
|
||||
"/special/",
|
||||
|
||||
405
api/index.php
405
api/index.php
@ -66,6 +66,26 @@ use Bitrix\Main\Context,
|
||||
Bitrix\Main\Loader,
|
||||
Bitrix\Iblock;
|
||||
|
||||
include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/php_interface/classes/tfpdf/tfpdf.php');
|
||||
|
||||
class PDF extends tFPDF
|
||||
{
|
||||
function Header()
|
||||
{
|
||||
$this->Image($_SERVER['DOCUMENT_ROOT']."/images/evo_pdf_header_image.jpg", 120, 10, 80, 8);
|
||||
$this->Ln(10);
|
||||
}
|
||||
|
||||
function Footer()
|
||||
{
|
||||
$this->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
|
||||
$this->SetY(-30);
|
||||
$this->SetFont('DejaVu', '', 5.5);
|
||||
$this->Ln(15);
|
||||
$this->MultiCell(100, 2, "ООО «ЛК Эволюция»\nИНН/КПП 9724016636/772401001\nр/с 40701810600760000017\nв ПАО «МОСКОВСКИЙ КРЕДИТНЫЙ БАНК»\nк/с 30101810745250000659\nБИК 044525659");
|
||||
}
|
||||
}
|
||||
|
||||
function checkRequestIsLocal()
|
||||
{
|
||||
if(!MODE_PRODUCTION)
|
||||
@ -1172,6 +1192,7 @@ switch($PARAM_1)
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
define("USED", filter_var($REQ['USED'], FILTER_VALIDATE_BOOLEAN));
|
||||
$filter = [ "ACTIVE" => "Y", ];
|
||||
|
||||
if(!empty($REQ['PROGRAM'])) { $filter['PROPERTY_LEASING_PROGRAMS'] = $REQ['PROGRAM']; }
|
||||
@ -1190,7 +1211,7 @@ switch($PARAM_1)
|
||||
$filter['><PROPERTY_ENGINE_VOLUME'] = [ !empty($REQ['ENGINE_VOLUME_FROM']) ? $REQ['ENGINE_VOLUME_FROM'] : 0, !empty($REQ['ENGINE_VOLUME_TO']) ? $REQ['ENGINE_VOLUME_TO'] : 10000 ];
|
||||
}
|
||||
|
||||
$total = CIBlockElement::GetList([ "SORT" => "ASC", "NAME" => "ASC" ], array_merge([ "IBLOCK_ID" => 1 ], $filter), [], []);
|
||||
$total = CIBlockElement::GetList([ "SORT" => "ASC", "NAME" => "ASC" ], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW ], $filter), [], []);
|
||||
|
||||
$gear = [];
|
||||
$drive = [];
|
||||
@ -1256,8 +1277,10 @@ switch($PARAM_1)
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
define("USED", filter_var($REQ['USED'], FILTER_VALIDATE_BOOLEAN));
|
||||
|
||||
$brands = [];
|
||||
$brands_res = CIBlockElement::GetList(["NAME" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => 8], false, []);
|
||||
$brands_res = CIBlockElement::GetList(["NAME" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => USED ? IBLOCK_ID_BRANDS_USED : IBLOCK_ID_BRANDS ], false, []);
|
||||
while ($brands_ob_element = $brands_res->GetNextElement())
|
||||
{
|
||||
$brands_ar_res = $brands_ob_element->GetFields();
|
||||
@ -1282,8 +1305,10 @@ switch($PARAM_1)
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
define("USED", filter_var($REQ['USED'], FILTER_VALIDATE_BOOLEAN));
|
||||
|
||||
$models = [];
|
||||
$models_res = CIBlockElement::GetList(["NAME" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => 9, "PROPERTY_BRAND_UID" => $REQ['BRAND_UID']], false, []);
|
||||
$models_res = CIBlockElement::GetList(["NAME" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => USED ? IBLOCK_ID_MODELS_USED : IBLOCK_ID_MODELS, "PROPERTY_BRAND_UID" => $REQ['BRAND_UID']], false, []);
|
||||
while ($models_ob_element = $models_res->GetNextElement())
|
||||
{
|
||||
$models_ar_res = $models_ob_element->GetFields();
|
||||
@ -1309,7 +1334,7 @@ switch($PARAM_1)
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$modifications = [];
|
||||
$modifications_res = CIBlockElement::GetList(["NAME" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => 10, "PROPERTY_MODEL_UID" => $REQ['MODEL_UID']], false, []);
|
||||
$modifications_res = CIBlockElement::GetList(["NAME" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS, "PROPERTY_MODEL_UID" => $REQ['MODEL_UID']], false, []);
|
||||
while ($modifications_ob_element = $modifications_res->GetNextElement())
|
||||
{
|
||||
$modifications_ar_res = $modifications_ob_element->GetFields();
|
||||
@ -1332,6 +1357,7 @@ switch($PARAM_1)
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
define("USED", filter_var($REQ['USED'], FILTER_VALIDATE_BOOLEAN));
|
||||
$filter = [ "ACTIVE" => "Y", ];
|
||||
|
||||
if(!empty($REQ['PROGRAM'])) { $filter['PROPERTY_LEASING_PROGRAMS'] = $REQ['PROGRAM']; }
|
||||
@ -1345,17 +1371,35 @@ switch($PARAM_1)
|
||||
if(!empty($REQ['BODY'])) { $filter["PROPERTY_BODY"] = $REQ['BODY']; }
|
||||
if(!empty($REQ['ENGINE_FUEL'])) { $filter["PROPERTY_ENGINE_FUEL"] = $REQ['ENGINE_FUEL']; }
|
||||
|
||||
if(!empty($REQ['VEHICLE_TYPE'])) { $filter["PROPERTY_VEHICLE_TYPE"] = $REQ['VEHICLE_TYPE']; }
|
||||
if(!empty($REQ['VEHICLE_SUBTYPE'])) { $filter["PROPERTY_VEHICLE_SUBTYPE"] = $REQ['VEHICLE_SUBTYPE']; }
|
||||
if(!empty($REQ['PARKING_CITY'])) { $filter["PROPERTY_PARKING_CITY"] = $REQ['PARKING_CITY']; }
|
||||
|
||||
if(!empty($REQ['ENGINE_VOLUME_FROM']) || !empty($REQ['ENGINE_VOLUME_TO']))
|
||||
{
|
||||
$filter['><PROPERTY_ENGINE_VOLUME'] = [ !empty($REQ['ENGINE_VOLUME_FROM']) ? $REQ['ENGINE_VOLUME_FROM'] : 0, !empty($REQ['ENGINE_VOLUME_TO']) ? $REQ['ENGINE_VOLUME_TO'] : 10000 ];
|
||||
}
|
||||
|
||||
$total = CIBlockElement::GetList([ "SORT" => "ASC", "NAME" => "ASC" ], array_merge([ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW ], $filter), [], []);
|
||||
if(!empty($REQ['YEAR_FROM']) || !empty($REQ['YEAR_TO']))
|
||||
{
|
||||
$filter['><PROPERTY_YEAR'] = [ !empty($REQ['YEAR_FROM']) ? $REQ['YEAR_FROM'] : 2000, !empty($REQ['YEAR_TO']) ? $REQ['YEAR_TO'] : date("YYYY") ];
|
||||
}
|
||||
|
||||
if(!empty($REQ['MILEAGE_FROM']) || !empty($REQ['MILEAGE_TO']))
|
||||
{
|
||||
$filter['><PROPERTY_MILEAGE'] = [ !empty($REQ['MILEAGE_FROM']) ? $REQ['MILEAGE_FROM'] : 0, !empty($REQ['MILEAGE_TO']) ? $REQ['MILEAGE_TO'] : 10000000 ];
|
||||
}
|
||||
|
||||
$total = CIBlockElement::GetList([ "SORT" => "ASC", "NAME" => "ASC" ], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW ], $filter), [], []);
|
||||
$result = [
|
||||
"total" => $total,
|
||||
"possible_volumes" => [],
|
||||
];
|
||||
|
||||
$vehicle_types = [];
|
||||
$vehicle_subtypes = [];
|
||||
$cities = [];
|
||||
|
||||
$brands = [];
|
||||
$models = [];
|
||||
$modifications = [];
|
||||
@ -1368,6 +1412,9 @@ switch($PARAM_1)
|
||||
|
||||
$filter_props_ids = [];
|
||||
|
||||
$years = [];
|
||||
$mileages = [];
|
||||
|
||||
array_push($filter_props_ids, 3);
|
||||
if(!empty($REQ['BRAND_ID'])) { array_push($filter_props_ids, 4); }
|
||||
array_push($filter_props_ids, 7);
|
||||
@ -1378,20 +1425,123 @@ switch($PARAM_1)
|
||||
|
||||
$result['filter'] = $filter;
|
||||
|
||||
if(USED)
|
||||
{
|
||||
//filter for types
|
||||
$filter_vehicle_types = $filter;
|
||||
unset($filter_vehicle_types['PROPERTY_VEHICLE_TYPE']);
|
||||
|
||||
$vehicle_types_list = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_USED, $filter_vehicle_types, true, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_USED_VEHICLE_TYPE ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($vehicle_types_list, $row[ PROPERTY_ID_CATALOG_CARS_USED_VEHICLE_TYPE ]);
|
||||
}
|
||||
|
||||
$vehicle_types_list = array_values(array_unique($vehicle_types_list));
|
||||
|
||||
$types_asc = [];
|
||||
$types_asc_res = CIBlockElement::GetList([ "SORT" => "ASC", "NAME" => "ASC" ], [ "IBLOCK_ID" => IBLOCK_ID_USED_TYPES ], false, []);
|
||||
while ($type_asc_ob_element = $types_asc_res->GetNextElement())
|
||||
{
|
||||
$type_asc_ar_res = $type_asc_ob_element->GetFields();
|
||||
if(in_array($type_asc_ar_res['NAME'], $vehicle_types_list))
|
||||
{
|
||||
array_push($vehicle_types, $type_asc_ar_res['NAME']);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($REQ['VEHICLE_TYPE']))
|
||||
{
|
||||
//filter for subtypes
|
||||
$filter_vehicle_subtypes = $filter;
|
||||
unset($filter_vehicle_subtypes['PROPERTY_VEHICLE_SUBTYPE']);
|
||||
|
||||
$vehicle_type = null;
|
||||
$type_res = CIBlockElement::GetList([], [ "IBLOCK_ID" => IBLOCK_ID_USED_TYPES, "NAME" => $REQ['VEHICLE_TYPE'] ], false, []);
|
||||
while ($type_ob_element = $type_res->GetNextElement())
|
||||
{
|
||||
$type_ar_res = $type_ob_element->GetFields();
|
||||
$vehicle_type = $type_ar_res['ID'];
|
||||
}
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_USED, array_merge($filter_vehicle_subtypes, [ "VEHICLE_TYPE" => $vehicle_type ]), true, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_USED_VEHICLE_SUBTYPE ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($vehicle_subtypes, $row[ PROPERTY_ID_CATALOG_CARS_USED_VEHICLE_SUBTYPE ]);
|
||||
}
|
||||
}
|
||||
|
||||
//filter for years
|
||||
$filter_years = $filter;
|
||||
unset($filter_years['><PROPERTY_YEAR']);
|
||||
|
||||
$bitrix_years = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_USED, $filter_years, true, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_USED_YEAR ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($bitrix_years, $row[ PROPERTY_ID_CATALOG_CARS_USED_YEAR ]);
|
||||
}
|
||||
sort($bitrix_years);
|
||||
$bitrix_years = array_values(array_unique($bitrix_years));
|
||||
|
||||
for($y = $bitrix_years[0]; $y <= $bitrix_years[count($bitrix_years)-1]; $y++)
|
||||
{
|
||||
array_push($years, $y);
|
||||
}
|
||||
|
||||
//filter for mileages
|
||||
$filter_mileages = $filter;
|
||||
unset($filter_mileages['><PROPERTY_MILEAGE']);
|
||||
|
||||
$bitrix_mileages = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_USED, $filter_mileages, true, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_USED_MILEAGE ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($bitrix_mileages, $row[ PROPERTY_ID_CATALOG_CARS_USED_MILEAGE ]);
|
||||
}
|
||||
sort($bitrix_mileages);
|
||||
$bitrix_mileages = array_values(array_unique($bitrix_mileages));
|
||||
|
||||
$mileage_max = $bitrix_mileages[count($bitrix_mileages)-1];
|
||||
$mileage_max = ceil($mileage_max / 50000);
|
||||
|
||||
$m = 0;
|
||||
while($m <= ($mileage_max))
|
||||
{
|
||||
array_push($mileages, $m * 50000);
|
||||
$m++;
|
||||
}
|
||||
|
||||
//filter for cities
|
||||
$filter_cities = $filter;
|
||||
unset($filter_cities['PROPERTY_PARKING_CITY']);
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_USED, $filter_cities, true, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_USED_PARKING_CITY ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
//print_r($row[ PROPERTY_ID_CATALOG_CARS_USED_PARKING_CITY ]);
|
||||
array_push($cities, $row[ PROPERTY_ID_CATALOG_CARS_USED_PARKING_CITY ]);
|
||||
}
|
||||
//print "\n\ncities\n\n";
|
||||
//print_r($cities);
|
||||
//die();
|
||||
}
|
||||
|
||||
//filter for brands
|
||||
$filter_brands = $filter;
|
||||
unset($filter_brands['PROPERTY_BRAND']);
|
||||
|
||||
$brands_ids = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_brands, true, [ 'ID' => [ 3 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_brands, true, [ 'ID' => [ USED ? PROPERTY_ID_CATALOG_CARS_USED_BRAND : PROPERTY_ID_CATALOG_CARS_NEW_BRAND ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($brands_ids, $row[ 3 ]);
|
||||
array_push($brands_ids, $row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_BRAND : PROPERTY_ID_CATALOG_CARS_NEW_BRAND ]);
|
||||
}
|
||||
|
||||
$brands_ids = array_values(array_unique($brands_ids));
|
||||
|
||||
$brands_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => IBLOCK_ID_BRANDS ], [ "ID" => $brands_ids ]), false, []);
|
||||
$brands_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_BRANDS_USED : IBLOCK_ID_BRANDS ], [ "ID" => $brands_ids ]), false, []);
|
||||
while ($brands_ob_element = $brands_res->GetNextElement())
|
||||
{
|
||||
$brands_ar_res = $brands_ob_element->GetFields();
|
||||
@ -1412,15 +1562,15 @@ switch($PARAM_1)
|
||||
unset($filter_models['PROPERTY_MODEL']);
|
||||
|
||||
$models_ids = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_models, true, [ 'ID' => [ 4 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_models, true, [ 'ID' => [ USED ? PROPERTY_ID_CATALOG_CARS_USED_MODEL : PROPERTY_ID_CATALOG_CARS_NEW_MODEL ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($models_ids, $row[ 4 ]);
|
||||
array_push($models_ids, $row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_MODEL : PROPERTY_ID_CATALOG_CARS_NEW_MODEL ]);
|
||||
}
|
||||
|
||||
$models_ids = array_values(array_unique($models_ids));
|
||||
|
||||
$models_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => IBLOCK_ID_MODELS ], [ "ID" => $models_ids ]), false, []);
|
||||
$models_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_MODELS_USED : IBLOCK_ID_MODELS ], [ "ID" => $models_ids ]), false, []);
|
||||
while ($models_ob_element = $models_res->GetNextElement())
|
||||
{
|
||||
$models_ar_res = $models_ob_element->GetFields();
|
||||
@ -1443,7 +1593,7 @@ switch($PARAM_1)
|
||||
|
||||
$modifications_ids = [];
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_modifications, true, [ 'ID' => [ 5 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_modifications, true, [ 'ID' => [ 5 ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($modifications_ids, $row[ 5 ]);
|
||||
@ -1467,7 +1617,7 @@ switch($PARAM_1)
|
||||
$filter_bodies = $filter;
|
||||
unset($filter_bodies['PROPERTY_BODY']);
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_bodies, true, [ 'ID' => [ 9 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_bodies, true, [ 'ID' => [ 9 ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($bodies, $row[ 9 ]);
|
||||
@ -1477,7 +1627,7 @@ switch($PARAM_1)
|
||||
$filter_gears = $filter;
|
||||
unset($filter_gears['PROPERTY_GEAR']);
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_gears, true, [ 'ID' => [ 7 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_gears, true, [ 'ID' => [ 7 ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($gears, $row[ 7 ]);
|
||||
@ -1487,7 +1637,7 @@ switch($PARAM_1)
|
||||
$filter_drives = $filter;
|
||||
unset($filter_drives['PROPERTY_DRIVE']);
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_drives, true, [ 'ID' => [ 8 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_drives, true, [ 'ID' => [ 8 ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($drives, $row[ 8 ]);
|
||||
@ -1497,23 +1647,23 @@ switch($PARAM_1)
|
||||
$filter_engine_fuels = $filter;
|
||||
unset($filter_engine_fuels['PROPERTY_ENGINE_FUEL']);
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_engine_fuels, true, [ 'ID' => [ 12 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_engine_fuels, true, [ 'ID' => [ USED ? PROPERTY_ID_CATALOG_CARS_USED_ENGINE_FUEL : PROPERTY_ID_CATALOG_CARS_NEW_ENGINE_FUEL ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($engine_fuels, $row[ 12 ]);
|
||||
array_push($engine_fuels, $row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_ENGINE_FUEL : PROPERTY_ID_CATALOG_CARS_NEW_ENGINE_FUEL ]);
|
||||
}
|
||||
|
||||
//filter for engine fuels
|
||||
$filter_engine_volumes = $filter;
|
||||
unset($filter_engine_volumes['><PROPERTY_ENGINE_VOLUME']);
|
||||
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $filter_engine_volumes, true, [ 'ID' => [ 11 ] ] );
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter_engine_volumes, true, [ 'ID' => [ USED ? PROPERTY_ID_CATALOG_CARS_USED_ENGINE_VOLUME : PROPERTY_ID_CATALOG_CARS_NEW_ENGINE_VOLUME ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
if($row[ 11 ] != 0)
|
||||
if($row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_ENGINE_VOLUME : PROPERTY_ID_CATALOG_CARS_NEW_ENGINE_VOLUME ] != 0)
|
||||
{
|
||||
array_push($engine_volumes, $row[ 11 ]);
|
||||
array_push($result["possible_volumes"], $row[ 11 ]);
|
||||
array_push($engine_volumes, $row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_ENGINE_VOLUME : PROPERTY_ID_CATALOG_CARS_NEW_ENGINE_VOLUME ]);
|
||||
array_push($result["possible_volumes"], $row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_ENGINE_VOLUME : PROPERTY_ID_CATALOG_CARS_NEW_ENGINE_VOLUME ]);
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -1544,6 +1694,9 @@ switch($PARAM_1)
|
||||
|
||||
//$models = array_values(array_unique($models));
|
||||
|
||||
$cities = array_values(array_unique($cities));
|
||||
sort($cities);
|
||||
|
||||
$gears = array_values(array_unique($gears));
|
||||
$drives = array_values(array_unique($drives));
|
||||
$bodies = array_values(array_unique($bodies));
|
||||
@ -1551,6 +1704,11 @@ switch($PARAM_1)
|
||||
$engine_volumes = array_values(array_unique($engine_volumes));
|
||||
sort($engine_volumes);
|
||||
|
||||
$vehicle_subtypes = array_values(array_unique($vehicle_subtypes));
|
||||
|
||||
$years = array_values(array_unique($years));
|
||||
$mileages = array_values(array_unique($mileages));
|
||||
|
||||
$bodies_slugs = [];
|
||||
foreach($bodies AS $bk => $bv)
|
||||
{
|
||||
@ -1577,6 +1735,9 @@ switch($PARAM_1)
|
||||
$min = $min + 100;
|
||||
}
|
||||
|
||||
$result["vehicle_types"] = $vehicle_types;
|
||||
$result["vehicle_subtypes"] = $vehicle_subtypes;
|
||||
|
||||
$result["brands"] = $brands;
|
||||
$result["models"] = $models;
|
||||
$result["modifications"] = $modifications;
|
||||
@ -1588,6 +1749,12 @@ switch($PARAM_1)
|
||||
$result["engine_fuels"] = $engine_fuels;
|
||||
$result["engine_fuels_slugs"] = $engine_fuels_slugs;
|
||||
|
||||
$result["cities"] = $cities;
|
||||
$result["years"] = $years;
|
||||
$result["mileages"] = $mileages;
|
||||
$result["bitrix_mileages"] = $bitrix_mileages;
|
||||
$result["bitrix_years"] = $bitrix_years;
|
||||
|
||||
//if(empty($REQ['ENGINE_VOLUME_FROM']) || empty($REQ['ENGINE_VOLUME_TO'])) {
|
||||
$result["engine_volumes"] = $volumes;
|
||||
//}
|
||||
@ -1637,6 +1804,190 @@ switch($PARAM_1)
|
||||
break;
|
||||
*/
|
||||
|
||||
case "pdf":
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$images = [];
|
||||
$car = [];
|
||||
|
||||
if(!empty($REQ['contract']))
|
||||
{
|
||||
$car_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_USED, "CODE" => $REQ['contract'] ], false, [], [] );
|
||||
while($car_search_ob = $car_search_res->GetNextElement())
|
||||
{
|
||||
$car = $car_search_ob->GetFields();
|
||||
$car['PROPERTIES'] = $car_search_ob->GetProperties();
|
||||
$car['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS_USED, $car['PROPERTIES']['BRAND']['VALUE']);
|
||||
$car['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS_USED, $car['PROPERTIES']['MODEL']['VALUE']);
|
||||
|
||||
$images = [];
|
||||
|
||||
foreach($car['PROPERTIES']['PHOTOS_1080']['VALUE'] AS $photo_id)
|
||||
{
|
||||
array_push($images, $_SERVER['DOCUMENT_ROOT'].CFile::GetPath($photo_id));
|
||||
}
|
||||
|
||||
$tech_array = [];
|
||||
if(!empty($car['PROPERTIES']['YEAR']['VALUE'])) { array_push($tech_array, "· Год выпуска: ".$car['PROPERTIES']['YEAR']['VALUE']); }
|
||||
if(!empty($car['PROPERTIES']['MILEAGE']['VALUE'])) { array_push($tech_array, "· Пробег: ".$car['PROPERTIES']['MILEAGE']['VALUE']." км"); }
|
||||
if(!empty($car['PROPERTIES']['ENGINE_HOURS']['VALUE'])) { array_push($tech_array, "· Моточасы: ".$car['PROPERTIES']['ENGINE_HOURS']['VALUE']); }
|
||||
if(!empty($car['PROPERTIES']['ENGINE_POWER']['VALUE'])) { array_push($tech_array, "· Л.с.: ".$car['PROPERTIES']['ENGINE_POWER']['VALUE']); }
|
||||
if(!empty($car['PROPERTIES']['ENGINE_VOLUME']['VALUE'])) { array_push($tech_array, "· Объем: ".$car['PROPERTIES']['ENGINE_VOLUME']['VALUE']); }
|
||||
if(!empty($car['PROPERTIES']['ENGINE_FUEL']['VALUE'])) { array_push($tech_array, "· Топливо: ".$car['PROPERTIES']['ENGINE_FUEL']['VALUE']); }
|
||||
if(!empty($car['PROPERTIES']['PARKING_REGION']['VALUE'])) { array_push($tech_array, "· Регион размещения: ".$car['PROPERTIES']['PARKING_REGION']['VALUE']); }
|
||||
if(!empty($car['PROPERTIES']['PARKING_CITY']['VALUE'])) { array_push($tech_array, "· Регион размещения: ".$car['PROPERTIES']['PARKING_CITY']['VALUE']); }
|
||||
}
|
||||
|
||||
if(isset($car['NAME']))
|
||||
{
|
||||
$pdf = new PDF();
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
|
||||
$pdf->AddFont('DejaVuBold','','DejaVuSansCondensed-Bold.ttf',true);
|
||||
$pdf->SetFont('DejaVuBold','',13);
|
||||
$pdf->Ln(-10);
|
||||
$pdf->Write(8,"Коммерческое предложение");
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('DejaVu','',12);
|
||||
$pdf->SetTextColor(110,110,110);
|
||||
$pdf->Write(8,"на транспортное средство с пробегом");
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetFont('DejaVuBold','',14);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$top_line_y = $pdf->GetY();
|
||||
$pdf->MultiCell(100, 6, $car['PROPERTIES']['BRAND']['RELATED']['NAME']." ".$car['PROPERTIES']['MODEL']['RELATED']['NAME']);
|
||||
$pdf->SetFont('DejaVu','',12);
|
||||
$pdf->SetTextColor(110,110,110);
|
||||
$pdf->MultiCell(100, 6, $car['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->Image(isset($images[0]) ? $images[0] : $_SERVER['DOCUMENT_ROOT']."/images/no_image_650.png", 11, $pdf->GetY(), 100, 75);
|
||||
|
||||
$under_photo_y = $pdf->GetY() + 75;
|
||||
|
||||
$pdf->SetXY(120, $top_line_y - 2);
|
||||
$pdf->SetFont('DejaVuBold','', 13);
|
||||
if($car['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0)
|
||||
{
|
||||
$pdf->SetTextColor(110,110,110);
|
||||
$pdf->Write(8, "Цена: ".number_format($car['PROPERTIES']['PRICE']['VALUE'], 0, " ", " ")." ₽");
|
||||
$pdf->SetXY(120, $top_line_y + 5);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->Write(8, "Цена со скидкой: ".number_format($car['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'], 0, " ", " ")." ₽");
|
||||
$pdf->Line(136, $top_line_y + 2, 165, $top_line_y + 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->Write(8, "Цена: ".number_format($car['PROPERTIES']['PRICE']['VALUE'], 0, " ", " ")." ₽");
|
||||
}
|
||||
|
||||
$pdf->SetXY(120, 55);
|
||||
$pdf->SetFont('DejaVuBold','', 11);
|
||||
$pdf->Write(8, "Артикул");
|
||||
$pdf->SetFont('DejaVu','', 11);
|
||||
$pdf->Write(8, ": ".$car['PROPERTIES']['CONTRACT']['VALUE']);
|
||||
$pdf->Ln(1);
|
||||
$pdf->SetXY(120, 62);
|
||||
$pdf->SetFont('DejaVuBold','', 11);
|
||||
$pdf->Write(8, "VIN");
|
||||
$pdf->SetFont('DejaVu','', 11);
|
||||
$pdf->Write(8, ": ".str_repeat("*", 12).substr($car['PROPERTIES']['VIN']['VALUE'], 12, 5));
|
||||
$pdf->SetXY(120, 75);
|
||||
$pdf->SetFont('DejaVuBold','', 11);
|
||||
$pdf->Write(8, "Ключевые характеристики");
|
||||
$pdf->SetXY(120, 82);
|
||||
$pdf->SetFont('DejaVu','', 11);
|
||||
$pdf->MultiCell(100, 6, implode("\n", $tech_array));
|
||||
|
||||
$pdf->SetXY(10, $under_photo_y + 5);
|
||||
$pdf->SetFont('DejaVuBold','', 11);
|
||||
$pdf->Write(8, "Комплектация");
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('DejaVu','', 10);
|
||||
$pdf->MultiCell(0, 4, str_replace("\t", " ", $car['~DETAIL_TEXT']));
|
||||
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('DejaVuBold','', 16);
|
||||
$pdf->Write(10, "Остались вопросы?");
|
||||
$pdf->Ln(7);
|
||||
$pdf->SetFont('DejaVuBold','', 13);
|
||||
$pdf->Write(8, "Позвоните по телефону горячей линии 8 800 333 75 75");
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('DejaVu','',12);
|
||||
$pdf->SetTextColor(110,110,110);
|
||||
$pdf->Write(8, "Или напишите по адресу электронной почты izt@evoleasing.ru");
|
||||
if(count($images) > 1)
|
||||
{
|
||||
$pdf->Ln(15);
|
||||
$pdf->SetFont('DejaVuBold','', 16);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->Write(10, "Остальные фотографии");
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('DejaVu','',10);
|
||||
|
||||
if($pdf->GetY() >= 199)
|
||||
{
|
||||
$pdf->AddPage();
|
||||
}
|
||||
|
||||
$x = 0;
|
||||
$y = 0;
|
||||
foreach($images AS $k => $image)
|
||||
{
|
||||
if($k > 0)
|
||||
{
|
||||
if($pdf->GetY() >= 199)
|
||||
{
|
||||
$pdf->AddPage();
|
||||
$y = 0;
|
||||
}
|
||||
|
||||
$pdf->Image($image, ($x * 90) + ($x > 0 ? 18 : 11), ((68 * $y) + $pdf->GetY()) + 10, 90, 68, "JPEG");
|
||||
if($x === 1)
|
||||
{
|
||||
$x = 0;
|
||||
$y = 0;
|
||||
$pdf->SetY($pdf->GetY() + 75);
|
||||
}
|
||||
else
|
||||
{
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->Output('D');
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
print json_encode([
|
||||
"status" => "error",
|
||||
"error" => "wrong_contract",
|
||||
"message" => "Wrong contract number",
|
||||
]);
|
||||
|
||||
die();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print json_encode([
|
||||
"status" => "error",
|
||||
"error" => "empty_contract",
|
||||
"message" => "Empty contract number",
|
||||
]);
|
||||
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case "reset":
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
@ -1902,7 +2253,7 @@ switch($PARAM_1)
|
||||
{
|
||||
$url = API_HOST."/site/RequestFromSite";
|
||||
|
||||
$payload = json_encode([
|
||||
$payload = [
|
||||
"region" => $_REQUEST['FORM_FIELD_REGION'],
|
||||
"name" => $REQ['FORM_FIELD_FIO'],
|
||||
"phone" => $REQ['FORM_FIELD_PHONE'],
|
||||
@ -1922,7 +2273,13 @@ switch($PARAM_1)
|
||||
"utm_content" => $_COOKIE['utm_content'],
|
||||
"page_url" => $REQ['FORM_FIELD_PAGE_URL'],
|
||||
"page_name" => $REQ['FORM_FIELD_PAGE_NAME'],
|
||||
]);
|
||||
];
|
||||
if(!empty($REQ['FORM_FIELD_IS_IZT']))
|
||||
{
|
||||
$payload['sale_type'] = "izt";
|
||||
}
|
||||
|
||||
$payload_json = json_encode($payload);
|
||||
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, API_HOST."/site/RequestFromSite");
|
||||
@ -1932,7 +2289,7 @@ switch($PARAM_1)
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($c, CURLOPT_POST, 1);
|
||||
curl_setopt($c, CURLOPT_POSTFIELDS, $payload);
|
||||
curl_setopt($c, CURLOPT_POSTFIELDS, $payload_json);
|
||||
curl_setopt($c, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
||||
|
||||
$response = curl_exec($c);
|
||||
|
||||
@ -146,4 +146,112 @@ function OnEpilogHandler()
|
||||
|
||||
\Bitrix\Main\Application::getInstance()->getExceptionHandler()->setHandlerOutput(new HttpExceptionHandlerOutput());
|
||||
|
||||
function zerof_request($path, $query)
|
||||
{
|
||||
$key_sha1 = strtoupper(sha1(ZEROF_PASSWORD, false));
|
||||
|
||||
$date = gmdate('D, d M Y H:i:s T');
|
||||
$string_to_sign = "";
|
||||
$string_to_sign .= "GET\n";
|
||||
$string_to_sign .= "\n";
|
||||
$string_to_sign .= $date."\n";
|
||||
$string_to_sign .= $path;
|
||||
|
||||
$data = mb_convert_encoding($string_to_sign, mb_detect_encoding($string_to_sign), "UTF-8");
|
||||
$hash = hash_hmac("SHA1", $data, $key_sha1, false);
|
||||
$hash_base64 = base64_encode(hex2bin($hash));
|
||||
|
||||
//print "HASH ".$hash_base64."\n";
|
||||
//print "DATE ".$date."\n";
|
||||
//print "\n";
|
||||
|
||||
$headers = [
|
||||
"Authorization: ZWS ".ZEROF_USERNAME.":".$hash_base64,
|
||||
"Date: ".$date,
|
||||
"Accept: application/json",
|
||||
];
|
||||
|
||||
$url = "https://api.zerof.ru".$path;
|
||||
if($query !== null)
|
||||
{
|
||||
$url = $url."?".http_build_query($query);
|
||||
}
|
||||
|
||||
$request = curl_init();
|
||||
curl_setopt($request, CURLOPT_URL, $url);
|
||||
curl_setopt($request, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($request, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($request, CURLOPT_HTTPHEADER, $headers);
|
||||
|
||||
$response = curl_exec($request) or die(curl_error($request));
|
||||
$http_code = curl_getinfo($request, CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($request);
|
||||
|
||||
return $http_code === 200 ? $response : false;
|
||||
}
|
||||
|
||||
function zerof_get_images($task_uid)
|
||||
{
|
||||
$images = [];
|
||||
$tasks_car_in_new = zerof_request("/v2/tasks/find", [ "status" => "new", "value" => $task_uid, "profile" => 703 ]);
|
||||
$tasks_car_in_process = zerof_request("/v2/tasks/find", [ "status" => "process", "value" => $task_uid, "profile" => 703 ]);
|
||||
$tasks_car_in_pass = zerof_request("/v2/tasks/find", [ "status" => "pass", "value" => $task_uid, "profile" => 703 ]);
|
||||
$tasks_trucks_in_new = zerof_request("/v2/tasks/find", [ "status" => "new", "value" => $task_uid, "profile" => 704 ]);
|
||||
$tasks_trucks_in_process = zerof_request("/v2/tasks/find", [ "status" => "process", "value" => $task_uid, "profile" => 704 ]);
|
||||
$tasks_trucks_in_pass = zerof_request("/v2/tasks/find", [ "status" => "pass", "value" => $task_uid, "profile" => 704 ]);
|
||||
|
||||
$tasks_car_in_process_data = json_decode(html_entity_decode($tasks_car_in_process), true);
|
||||
$tasks_car_in_pass_data = json_decode(html_entity_decode($tasks_car_in_pass), true);
|
||||
$tasks_car_in_new_data = json_decode(html_entity_decode($tasks_car_in_new), true);
|
||||
$tasks_trucks_in_process_data = json_decode(html_entity_decode($tasks_trucks_in_process), true);
|
||||
$tasks_trucks_in_pass_data = json_decode(html_entity_decode($tasks_trucks_in_pass), true);
|
||||
$tasks_trucks_in_new_data = json_decode(html_entity_decode($tasks_trucks_in_new), true);
|
||||
|
||||
//var_dump($images_response_array);
|
||||
|
||||
$tasks = array_merge(
|
||||
$tasks_car_in_process_data[array_keys($tasks_car_in_process_data)[0]],
|
||||
$tasks_car_in_pass_data[array_keys($tasks_car_in_pass_data)[0]],
|
||||
$tasks_car_in_new_data[array_keys($tasks_car_in_new_data)[0]],
|
||||
$tasks_trucks_in_process_data[array_keys($tasks_trucks_in_process_data)[0]],
|
||||
$tasks_trucks_in_pass_data[array_keys($tasks_trucks_in_pass_data)[0]],
|
||||
$tasks_trucks_in_new_data[array_keys($tasks_trucks_in_new_data)[0]],
|
||||
);
|
||||
|
||||
print "\n".$task_uid." TASKS:\n";
|
||||
print_r($tasks[0]);
|
||||
if(isset($tasks[0]))
|
||||
{
|
||||
$task_string = zerof_request("/v2/tasks/".$tasks[0]['id'], null);
|
||||
$task = json_decode(html_entity_decode($task_string), true);
|
||||
|
||||
print "TASK:\n";
|
||||
print_r($task);
|
||||
|
||||
foreach($task['views'][0]['files'] AS $file)
|
||||
{
|
||||
$image = zerof_request("/v2/tasks/downloadfile", [ "id" => $tasks[0]['id'], "name" => $file['name'] ]);
|
||||
print_r("DOWNLOADED LEN OF IMAGE FILE: ".strlen($image));
|
||||
print "\n";
|
||||
if(strlen($image) < 100)
|
||||
{
|
||||
print "IMAGE ???? ".$image."\n\n";
|
||||
}
|
||||
|
||||
if($image)
|
||||
{
|
||||
array_push($images, $image);
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
print "\n";
|
||||
}
|
||||
print "\n";
|
||||
|
||||
return $images;
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
images/evo_pdf_header_image.jpg
Normal file
BIN
images/evo_pdf_header_image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
5
images/icons/Bell.svg
Normal file
5
images/icons/Bell.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5.26904 9.75C5.2678 8.86051 5.44262 7.97957 5.78343 7.15796C6.12424 6.33635 6.6243 5.59031 7.25477 4.96286C7.88525 4.33541 8.63368 3.83895 9.45693 3.5021C10.2802 3.16525 11.1619 2.99467 12.0514 3.00019C15.763 3.02778 18.7317 6.11282 18.7317 9.83474V10.5C18.7317 13.8577 19.4342 15.8062 20.0529 16.8711C20.1196 16.9849 20.1551 17.1142 20.1558 17.2461C20.1565 17.378 20.1224 17.5077 20.0569 17.6222C19.9915 17.7367 19.8971 17.8319 19.7831 17.8982C19.6691 17.9646 19.5397 17.9997 19.4078 18H4.59222C4.46034 17.9997 4.33087 17.9645 4.21689 17.8982C4.1029 17.8318 4.00844 17.7366 3.94301 17.6221C3.87759 17.5076 3.84352 17.3778 3.84425 17.2459C3.84498 17.1141 3.88048 16.9847 3.94716 16.8709C4.56622 15.806 5.26904 13.8575 5.26904 10.5L5.26904 9.75Z" fill="#ED0A34" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9 18V18.75C9 19.5456 9.31607 20.3087 9.87868 20.8713C10.4413 21.4339 11.2044 21.75 12 21.75C12.7956 21.75 13.5587 21.4339 14.1213 20.8713C14.6839 20.3087 15 19.5456 15 18.75V18" fill="#ED0A34"/>
|
||||
<path d="M9 18V18.75C9 19.5456 9.31607 20.3087 9.87868 20.8713C10.4413 21.4339 11.2044 21.75 12 21.75C12.7956 21.75 13.5587 21.4339 14.1213 20.8713C14.6839 20.3087 15 19.5456 15 18.75V18" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
5
images/icons/approve_icon.svg
Normal file
5
images/icons/approve_icon.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="34" height="40" viewBox="0 0 34 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M32.5 23.0769C32.5 31.5884 25.5668 38.5 17 38.5C8.43317 38.5 1.5 31.5884 1.5 23.0769C1.5 14.5654 8.43317 7.65384 17 7.65384C25.5668 7.65384 32.5 14.5654 32.5 23.0769Z" stroke="white" stroke-width="3"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1957 2C11.1957 0.895431 12.0911 0 13.1957 0H20.529C21.6336 0 22.529 0.895431 22.529 2V2.10256C22.529 3.20713 21.6336 4.10256 20.529 4.10256H18.5758V7.36712H15.2587V4.10256H13.1957C12.0911 4.10256 11.1957 3.20713 11.1957 2.10256V2ZM2.65408 11.6023C2.65408 12.8603 3.19769 13.9919 4.06383 14.777L10.4592 9.08443C9.67555 8.00898 8.40296 7.30957 6.96627 7.30957C4.58471 7.30957 2.65408 9.23147 2.65408 11.6023ZM31.513 11.6023C31.513 12.8603 30.9694 13.9919 30.1032 14.777L23.7079 9.08443C24.4915 8.00898 25.7641 7.30957 27.2008 7.30957C29.5823 7.30957 31.513 9.23147 31.513 11.6023Z" fill="white"/>
|
||||
<path d="M21.0216 20.0638C21.0907 18.7842 20.466 16.2251 17.4143 16.2251M17.4143 16.2251C13.5997 16.2251 13.4338 19.2795 13.4338 20.0638C13.4338 20.848 14.2631 23.2007 17.4143 23.8199C20.5655 24.439 21.0216 26.09 21.0216 27.6585C21.0216 29.227 19.9021 30.878 17.4143 30.878M17.4143 16.2251V13.5422M17.4143 30.878C14.9265 30.878 12.646 29.9287 12.646 26.8743M17.4143 30.878V33.3546" stroke="white" stroke-width="3"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
BIN
images/no_image_500x300.png
Normal file
BIN
images/no_image_500x300.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@ -15,6 +15,7 @@ $APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_N
|
||||
"evolution:form.catalog.filter",
|
||||
"",
|
||||
Array(
|
||||
"SWITCH" => true,
|
||||
"SELECTED" => [],
|
||||
"SORTING" => false,
|
||||
"PATH" => "/catalog/",
|
||||
|
||||
@ -21,7 +21,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
$arResult = [];
|
||||
$sort = Array("SORT" => "ASC", "NAME" => "ASC");
|
||||
$filter = Array("IBLOCK_ID" => 1, "CODE" => $arParams['OFFER']);
|
||||
$filter = Array("IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "CODE" => $arParams['OFFER']);
|
||||
$options = Array("nPageSize" => 1);
|
||||
|
||||
$res = CIBlockElement::GetList($sort, $filter, false, $options);
|
||||
|
||||
@ -43,7 +43,7 @@ $this->setFrameMode(true);
|
||||
<p><b>Ключевые характеристики</b></p>
|
||||
<ul class="list-column">
|
||||
<li>Модельный год: <?= $arResult['PROPERTIES']['MODIFICATION_YEAR']['VALUE']; ?></li>
|
||||
<li>КПП: <?= $arResult['PROPERTIES']['GER']['VALUE']; ?></li>
|
||||
<li>КПП: <?= $arResult['PROPERTIES']['GEAR']['VALUE']; ?></li>
|
||||
<li>Привод: <?= $arResult['PROPERTIES']['DRIVE']['VALUE']; ?></li>
|
||||
<li>Кузов: <?= $arResult['PROPERTIES']['BODY']['VALUE']; ?></li>
|
||||
<li>Л.с.: <?= $arResult['PROPERTIES']['ENGINE_POWER']['VALUE']; ?></li>
|
||||
|
||||
@ -15,12 +15,20 @@ $this->setFrameMode(true);
|
||||
<div class="catalog_sort">
|
||||
<div class="sort_container sort_selector">
|
||||
<button class="i-sort">Сортировка:
|
||||
<? if($arParams['USED']): ?>
|
||||
<?= $arParams['SORT'] === "" || $arParams['SORT'] === null || $arParams['SORT'] === "date" ? "По дате добавления" : ""; ?>
|
||||
<? else: ?>
|
||||
<?= $arParams['SORT'] === "" || $arParams['SORT'] === null || $arParams['SORT'] === "name" ? "По названию" : ""; ?>
|
||||
<? endif; ?>
|
||||
<?= $arParams['SORT'] === "low" ? "По минимальной цене" : ""; ?>
|
||||
<?= $arParams['SORT'] === "high" ? "По максимальной цене" : ""; ?>
|
||||
</button>
|
||||
<ul data-position="left">
|
||||
<? if($arParams['USED']): ?>
|
||||
<li class="sort_option <?= $arParams['SORT'] === "" || $arParams['SORT'] === null || $arParams['SORT'] === "date" ? "active" : ""; ?>" data-value="date">По дате добавления</li>
|
||||
<? else: ?>
|
||||
<li class="sort_option <?= $arParams['SORT'] === "" || $arParams['SORT'] === null || $arParams['SORT'] === "name" ? "active" : ""; ?>" data-value="name">По названию</li>
|
||||
<? endif; ?>
|
||||
<li class="sort_option <?= $arParams['SORT'] === "low" ? "active" : ""; ?>" data-value="low">По минимальной цене</li>
|
||||
<li class="sort_option <?= $arParams['SORT'] === "high" ? "active" : ""; ?>" data-value="high">По максимальной цене</li>
|
||||
</ul>
|
||||
|
||||
@ -125,6 +125,7 @@ if(!empty($arResult['SUBTITLE']))
|
||||
"evolution:form.catalog.filter",
|
||||
"",
|
||||
Array(
|
||||
"SWITCH" => false,
|
||||
"SELECTED" => $arResult['SELECTED'],
|
||||
"PATH" => $arParams['PATH'],
|
||||
"SORTING" => true,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,25 @@
|
||||
@media all and (max-width: 767px)
|
||||
{
|
||||
.filter_used_desktop
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.filter_used_mobile
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px)
|
||||
{
|
||||
.filter_used_desktop
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.filter_used_mobile
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@ -11,11 +11,66 @@
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
|
||||
function render_select($code, $title)
|
||||
{
|
||||
return <<<HTML
|
||||
<div class="form_field">
|
||||
<select class="filter_$code catalog_filter_select">
|
||||
<option value="" disabled selected>$title</option>
|
||||
</select>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function render_years_from()
|
||||
{
|
||||
return <<<HTML
|
||||
<div class="form_field">
|
||||
<select class="filter_years catalog_filter_select">
|
||||
<option value="" disabled selected>Год, от</option>
|
||||
</select>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function render_engine_volume_from()
|
||||
{
|
||||
return <<<HTML
|
||||
<div class="form_field">
|
||||
<select class="filter_engine_volume_from catalog_filter_select">
|
||||
<option value="" disabled selected>Объем, от</option>
|
||||
<? $i = 100; ?>
|
||||
<? while($i < 7100): ?>
|
||||
<option value="<?= $i; ?>">От <?= is_float($i / 1000) ? $i / 1000 : ($i / 1000).".0"; ?> л.</option>
|
||||
<? $i = $i + 100; ?>
|
||||
<? endwhile; ?>
|
||||
</select>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function render_engine_volume_to()
|
||||
{
|
||||
return <<<HTML
|
||||
<div class="form_field">
|
||||
<select class="filter_engine_volume_to catalog_filter_select">
|
||||
<option value="" disabled selected>Объем, до</option>
|
||||
<? $i = 100; ?>
|
||||
<? while($i < 7100): ?>
|
||||
<option value="<?= $i; ?>">До <?= is_float($i / 1000) ? $i / 1000 : ($i / 1000).".0"; ?> л.</option>
|
||||
<? $i = $i + 100; ?>
|
||||
<? endwhile; ?>
|
||||
</select>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
formCatalogFilter("<?= $arParams['PATH']; ?>", "<?= $arParams['PROGRAM']; ?>", <?= CUtil::PhpToJSObject($arResult['SELECTED']); ?>);
|
||||
formCatalogFilter("<?= $arParams['PATH']; ?>", "<?= $arParams['PROGRAM']; ?>", <?= CUtil::PhpToJSObject($arResult['SELECTED']); ?>, <?= $arParams['USED'] ? "true" : "false"; ?>);
|
||||
<? if($arResult['SCROLL']): ?>
|
||||
$('html, body').animate({
|
||||
scrollTop: $("#catalog").offset().top - 100
|
||||
@ -41,12 +96,13 @@ $this->setFrameMode(true);
|
||||
top: 50px;
|
||||
left: 50px
|
||||
}
|
||||
#catalog_filter_spinner {
|
||||
.catalog_filter_spinner {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
background: none;
|
||||
position: absolute;
|
||||
}
|
||||
.catalog_filter_spinner_animation {
|
||||
width: 100%;
|
||||
@ -59,71 +115,81 @@ $this->setFrameMode(true);
|
||||
.catalog_filter_spinner_animation div { box-sizing: content-box; }
|
||||
</style>
|
||||
<form method="GET" action="/catalog/" id="catalog_filter_form">
|
||||
<div class="catalog_filter_new" style="display: <?= !$arParams['USED'] ? "block" : "none"; ?>">
|
||||
<div class="filter_body">
|
||||
<div class="filter_column">
|
||||
<div class="form_field">
|
||||
<select id="filter_brands" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Марка</option>
|
||||
</select>
|
||||
</div>
|
||||
<?= render_select("brands", "Марка"); ?>
|
||||
<div class="fieldgroup">
|
||||
<div class="form_field">
|
||||
<select id="filter_bodies" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Кузов</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select id="filter_gears" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Коробка</option>
|
||||
</select>
|
||||
</div>
|
||||
<?= render_select("bodies", "Кузов"); ?>
|
||||
<?= render_select("gears", "Коробка"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter_column">
|
||||
<div class="form_field">
|
||||
<select id="filter_models" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Модель</option>
|
||||
</select>
|
||||
</div>
|
||||
<?= render_select("models", "Модель"); ?>
|
||||
<div class="fieldgroup">
|
||||
<div class="form_field">
|
||||
<select id="filter_engine_fuels" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Двигатель</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select id="filter_drives" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Привод</option>
|
||||
</select>
|
||||
</div>
|
||||
<?= render_select("engine_fuels", "Двигатель"); ?>
|
||||
<?= render_select("drives", "Привод"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter_column">
|
||||
<div class="form_field">
|
||||
<select id="filter_modifications" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Модификация</option>
|
||||
</select>
|
||||
<?= render_select("modifications", "Модификация"); ?>
|
||||
<div class="fieldgroup">
|
||||
<?= render_engine_volume_from(); ?>
|
||||
<?= render_engine_volume_to(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="catalog_filter_used" style="display: <?= !$arParams['USED'] ? "none" : "block"; ?>">
|
||||
<div class="filter_used_desktop">
|
||||
<div class="filter_body static">
|
||||
<div class="filter_column">
|
||||
<div class="fieldgroup">
|
||||
<?= render_select("vehicle_type", "Тип"); ?>
|
||||
<?= render_select("vehicle_subtype", "Уточнить тип"); ?>
|
||||
</div>
|
||||
<?= render_select("city", "Город"); ?>
|
||||
</div>
|
||||
<div class="filter_column">
|
||||
<?= render_select("brands_used", "Марка"); ?>
|
||||
<div class="fieldgroup"> <!-- убрать отступ на мобилках класс no_space -->
|
||||
<?= render_select("year_from", "Год, от"); ?>
|
||||
<?= render_select("year_to", "Год, до"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter_column">
|
||||
<?= render_select("models_used", "Модель"); ?>
|
||||
<div class="fieldgroup">
|
||||
<?= render_select("mileage_from", "Пробег, от"); ?>
|
||||
<?= render_select("mileage_to", "Пробег, до"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter_used_mobile">
|
||||
<div class="filter_body static">
|
||||
<div class="filter_column">
|
||||
<div class="fieldgroup">
|
||||
<?= render_select("vehicle_type", "Тип"); ?>
|
||||
<?= render_select("vehicle_subtype", "Уточнить тип"); ?>
|
||||
</div>
|
||||
<?= render_select("brands_used", "Марка"); ?>
|
||||
<?= render_select("models_used", "Модель"); ?>
|
||||
<?= render_select("city", "Город"); ?>
|
||||
</div>
|
||||
<div class="filter_column">
|
||||
</div>
|
||||
<div class="filter_column">
|
||||
<div class="fieldgroup"> <!-- убрать отступ на мобилках класс no_space -->
|
||||
<?= render_select("year_from", "Год, от"); ?>
|
||||
<?= render_select("year_to", "Год, до"); ?>
|
||||
</div>
|
||||
<div class="fieldgroup">
|
||||
<div class="form_field">
|
||||
<select id="filter_engine_volume_from" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Объем, от</option>
|
||||
<? $i = 100; ?>
|
||||
<? while($i < 7100): ?>
|
||||
<option value="<?= $i; ?>">От <?= is_float($i / 1000) ? $i / 1000 : ($i / 1000).".0"; ?> л.</option>
|
||||
<? $i = $i + 100; ?>
|
||||
<? endwhile; ?>
|
||||
</select>
|
||||
<?= render_select("mileage_from", "Пробег, от"); ?>
|
||||
<?= render_select("mileage_to", "Пробег, до"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select id="filter_engine_volume_to" class="catalog_filter_select">
|
||||
<option value="" disabled selected>Объем, до</option>
|
||||
<? $i = 100; ?>
|
||||
<? while($i < 7100): ?>
|
||||
<option value="<?= $i; ?>">До <?= is_float($i / 1000) ? $i / 1000 : ($i / 1000).".0"; ?> л.</option>
|
||||
<? $i = $i + 100; ?>
|
||||
<? endwhile; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
@ -138,27 +204,26 @@ $this->setFrameMode(true);
|
||||
</div>
|
||||
*/
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter_header">
|
||||
<div class="tabs">
|
||||
<?
|
||||
/*
|
||||
<div class="tab active">Новые</div>
|
||||
<div class="tab">С пробегом</div>
|
||||
<? if($arParams['SWITCH']): ?>
|
||||
<div class="tab active" data-type="new">Новые</div>
|
||||
<div class="tab" data-type="used">С пробегом</div>
|
||||
<?/*
|
||||
<div class="tab">Все</div>
|
||||
*/
|
||||
?>
|
||||
*/?>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<div class="button_group">
|
||||
<button class="button button-transparent" id="catalog_filter_reset_button">Очистить фильтр</button>
|
||||
<button class="button button-blue" id="catalog_filter_search_button">
|
||||
<div id="catalog_filter_spinner">
|
||||
<button class="button button-transparent catalog_filter_reset_button">Очистить фильтр</button>
|
||||
<button class="button button-blue catalog_filter_search_button">
|
||||
<div class="catalog_filter_spinner">
|
||||
<div class="catalog_filter_spinner_animation">
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<span id="catalog_filter_search_button_counter" style="display:none;"></span>
|
||||
<span class="catalog_filter_search_button_counter" style="min-width: 200px;"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
18
local/components/evolution/form.leasing.used/component.php
Normal file
18
local/components/evolution/form.leasing.used/component.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?
|
||||
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;
|
||||
|
||||
$this->includeComponentTemplate();
|
||||
@ -0,0 +1,149 @@
|
||||
var leasing_form_submitting = false;
|
||||
var leasing_form_used_buy = true;
|
||||
|
||||
function check_errors()
|
||||
{
|
||||
var valid = true;
|
||||
|
||||
if(!$("#FORM_FIELD_FIO").val())
|
||||
{
|
||||
valid = false;
|
||||
$("#FORM_FIELD_FIO_wrapper").addClass("error").attr("data-error", "Необходимо указать Ваши ФИО");
|
||||
}
|
||||
if(!$("#FORM_FIELD_PHONE").val())
|
||||
{
|
||||
valid = false;
|
||||
$("#FORM_FIELD_PHONE_wrapper").addClass("error").attr("data-error", "Необходимо указать номер Вашего телефона");
|
||||
}
|
||||
if(!$("#FORM_FIELD_EMAIL").val())
|
||||
{
|
||||
valid = false;
|
||||
$("#FORM_FIELD_EMAIL_wrapper").addClass("error").attr("data-error", "Необходимо указать Ваш адрес E-mail");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!is_email($("#FORM_FIELD_EMAIL").val()))
|
||||
{
|
||||
valid = false;
|
||||
$("#FORM_FIELD_EMAIL_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите правильный адрес E-mail");
|
||||
}
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
function form_leasing_request_submit()
|
||||
{
|
||||
var accept = $("#policy").is(':checked');
|
||||
if(!leasing_form_submitting && accept)
|
||||
{
|
||||
if(check_errors())
|
||||
{
|
||||
leasing_form_submitting = true;
|
||||
$("#send_button_text").css("display", "none");
|
||||
$("#send_button_spinner").css("display", "block");
|
||||
|
||||
$("#form_leasing_request").find("input").removeClass("error");
|
||||
|
||||
var formData = new FormData($("#form_leasing_request")[0]);
|
||||
formData.append("form", "FORM_LEASING_REQUESTS");
|
||||
formData.append("FORM_FIELD_PAGE_NAME", document.title);
|
||||
formData.append("FORM_FIELD_PAGE_URL", window.location.href);
|
||||
formData.append("FORM_FIELD_BRAND", $("#FORM_FIELD_BRAND").val() ? $("#FORM_FIELD_BRAND").val() : "");
|
||||
formData.append("FORM_FIELD_MODEL", $("#FORM_FIELD_MODEL").val() ? $("#FORM_FIELD_MODEL").val() : "");
|
||||
formData.append("FORM_FIELD_MODIFICATION", $("#FORM_FIELD_MODIFICATION").val() ? $("#FORM_FIELD_MODIFICATION").val() : "");
|
||||
formData.append("FORM_FIELD_PRICE", $("#FORM_FIELD_PRICE").val() ? $("#FORM_FIELD_PRICE").val() : "");
|
||||
formData.append("FORM_FIELD_PREPAID", $("#FORM_FIELD_PREPAID").val() ? $("#FORM_FIELD_PREPAID").val() : "");
|
||||
formData.append("FORM_FIELD_TERM", $("#FORM_FIELD_TERM").val() ? $("#FORM_FIELD_TERM").val() : "");
|
||||
formData.append("FORM_FIELD_REDEMPTION", $("#FORM_FIELD_REDEMPTION").val() ? $("#FORM_FIELD_REDEMPTION").val() : "");
|
||||
formData.append("FORM_FIELD_IS_IZT", $("#FORM_FIELD_IS_IZT").val() !== "" ? $("#FORM_FIELD_IS_IZT").val() : "");
|
||||
|
||||
grecaptcha.ready(function()
|
||||
{
|
||||
grecaptcha.execute($("meta[name=recaptcha_site_key]").attr("content"), { action: 'submit' }).then(function(token)
|
||||
{
|
||||
formData.append("recaptcha_token", token);
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
{
|
||||
if(response.status === "complete")
|
||||
{
|
||||
$("#form_leasing_info").css("display", "none");
|
||||
$("#form_leasing_process").css("display","none");
|
||||
$("#form_leasing_success").css("display","flex");
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
|
||||
try
|
||||
{
|
||||
ym(66905533,'reachGoal','leasingform')
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
else if(response.status === "error")
|
||||
{
|
||||
for(var i in response.errors)
|
||||
{
|
||||
$("#form_leasing_request").find("*[name="+response.errors[i]+"]").addClass("error");
|
||||
}
|
||||
|
||||
if(response.message === "recaptcha_error")
|
||||
{
|
||||
$("#form_leasing_info").css("display", "none");
|
||||
$("#form_leasing_process").css("display","none");
|
||||
$("#form_leasing_fail").css("display","flex").parent().css("backgroundColor", "#2C2D2E");
|
||||
}
|
||||
|
||||
$("#send_button_text").css("display", "block");
|
||||
$("#send_button_spinner").css("display", "none");
|
||||
|
||||
leasing_form_submitting = false;
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
$("#form_leasing_request").find("input").on("keypress", function()
|
||||
{
|
||||
$(this).parent().removeClass("error").attr("data-error", null);
|
||||
});
|
||||
|
||||
$("#form_leasing_send_button").on("click", function()
|
||||
{
|
||||
form_leasing_request_submit();
|
||||
});
|
||||
|
||||
$("#form_leasing_request").on("submit", function(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
form_leasing_request_submit();
|
||||
});
|
||||
|
||||
$("#policy").on("change", function()
|
||||
{
|
||||
if($(this).is(':checked'))
|
||||
{
|
||||
$("#leasing_send_button").attr("disabled", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#leasing_send_button").attr("disabled", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,97 @@
|
||||
<?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);
|
||||
?>
|
||||
<style type="text/css">
|
||||
@keyframes send_button_spinner_animation {
|
||||
0% { transform: translate(-50%,-50%) rotate(0deg); }
|
||||
100% { transform: translate(-50%,-50%) rotate(360deg); }
|
||||
}
|
||||
.send_button_spinner_animation div {
|
||||
position: absolute;
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
border: 5px solid #1c01a9;
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.send_button_spinner_animation div {
|
||||
animation: send_button_spinner_animation 1s linear infinite;
|
||||
top: 50px;
|
||||
left: 50px
|
||||
}
|
||||
#send_button_spinner {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
background: none;
|
||||
}
|
||||
.send_button_spinner_animation {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
transform: translateZ(0) scale(0.28);
|
||||
backface-visibility: hidden;
|
||||
transform-origin: 0 0; /* see note above */
|
||||
}
|
||||
.send_button_spinner_animation div { box-sizing: content-box; }
|
||||
</style>
|
||||
<a name="order"></a>
|
||||
<section id="order">
|
||||
<div class="container">
|
||||
<h2 class="order_title">Купить автомобиль с пробегом</h2>
|
||||
<h3 class="order_title_sub">Проверенные автомобили с прозрачной историей</h2>
|
||||
<div class="order_form">
|
||||
<div class="order_email">
|
||||
<p>Напишите на <a href="mailto:izt@evoleasing.ru" id="form_leasing_used_email">izt@evoleasing.ru</a> или заполните форму</p>
|
||||
</div>
|
||||
<form id="form_leasing_request">
|
||||
<div id="form_leasing_process" style="position:relative;">
|
||||
<input type="hidden" name="FORM_FIELD_IS_IZT" id="FORM_FIELD_IS_IZT"/>
|
||||
<div class="form_field" id="FORM_FIELD_FIO_wrapper">
|
||||
<input type="text" id="FORM_FIELD_FIO" name="FORM_FIELD_FIO" value="" placeholder="Имя *"/>
|
||||
</div>
|
||||
<div class="form_field" id="FORM_FIELD_PHONE_wrapper">
|
||||
<input type="tel" id="FORM_FIELD_PHONE" name="FORM_FIELD_PHONE" value="" placeholder="Телефон *"/>
|
||||
</div>
|
||||
<div class="form_field" id="FORM_FIELD_EMAIL_wrapper">
|
||||
<input type="text" id="FORM_FIELD_EMAIL" name="FORM_FIELD_EMAIL" value="" placeholder="E-mail *"/>
|
||||
</div>
|
||||
<div class="form_field" id="FORM_FIELD_COMPANY_wrapper">
|
||||
<input type="text" id="FORM_FIELD_COMPANY" name="FORM_FIELD_COMPANY" value="" placeholder="Организация" />
|
||||
</div>
|
||||
<div class="policy">
|
||||
<input type="checkbox" name="policy" id="policy" hidden checked/>
|
||||
<label for="policy">Даю свое согласие на обработку <u class="personal_data_link" id="personal_data_link">моих персональных данных</u></label>
|
||||
</div>
|
||||
<button type="submit" class="button" id="leasing_send_button" style="width:110px; display: flex; justify-content: center;">
|
||||
<div id="send_button_spinner" style="display:none;">
|
||||
<div class="send_button_spinner_animation">
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<span id="send_button_text" style="display:block;">Отправить</span>
|
||||
</button>
|
||||
</div>
|
||||
<div id="form_leasing_success" style="min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Благодарим Вас за обращение, наши специалисты свяжутся с Вами в ближайшее время.</p>
|
||||
</div>
|
||||
<div id="form_leasing_fail" style="background-color: #2C2D2E; min-height: 400px; align-items: center; justify-content: center; display: none;">
|
||||
<p style="color: #fff; font-size: 24px; line-height: 34px;">Сожалеем, запросы, отправляемые с Вашего устройства похожи на автоматические. Пожалуйста, воспользуйтесь другим браузером/подключением или попробуйте позднее.</p>
|
||||
</div>
|
||||
<div id="form_leasing_info" style="position:absolute; left:10px; bottom:9px; font-size: 9px; color: #FFF; opacity: 0.5; line-height:11px;">защита от спама reCAPTCHA<br><a href="https://policies.google.com/privacy" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Конфиденциальность</a> - <a href="https://policies.google.com/terms" target="_blank" style="font-size: 9px; color: #FFF; text-decoration:underline;">Условия использования</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@ -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,13 @@
|
||||
<?
|
||||
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 */
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$MESS ['DEFAULT_NAME'] = "Позиция в каталоге ИЗТ";
|
||||
$MESS ['DEFAULT_DESC'] = "Позиция в каталоге ИЗТ";
|
||||
?>
|
||||
@ -0,0 +1,69 @@
|
||||
.used_item_tags {
|
||||
display: flow-root;
|
||||
/*padding-left: 0px!important;*/
|
||||
/*padding-right: 0px!important;*/
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.used_item_tag {
|
||||
font-size: 10px;
|
||||
color: white;
|
||||
width: fit-content;
|
||||
margin-right: 4px;
|
||||
margin-bottom: 4px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.used_item_special_offer {
|
||||
background-color: #a8026b;
|
||||
}
|
||||
|
||||
.used_item_reserve {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.used_item_discount {
|
||||
background-color: #04a8a4;
|
||||
}
|
||||
|
||||
.used_item_leasing {
|
||||
background-color: #1c01a9;
|
||||
}
|
||||
|
||||
.used_item_accident {
|
||||
background-color: #9e9e9e;
|
||||
}
|
||||
|
||||
.used_item_img {
|
||||
height: 180px !important;
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) and (max-width: 1280px) {
|
||||
.used_item_img {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 1320px) {
|
||||
.used_item_img {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.used_item_number {
|
||||
font-size: 15px !important;
|
||||
color: #8e94a7 !important;
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) {
|
||||
.used_item_img {
|
||||
}
|
||||
}
|
||||
|
||||
.car_used_sold {
|
||||
filter: grayscale(0.8);
|
||||
opacity: 0.4;
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
<?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);
|
||||
|
||||
$description = [];
|
||||
|
||||
if(!empty($arParams['PROPERTIES']['YEAR']['VALUE'])) { array_push($description, $arParams['PROPERTIES']['YEAR']['VALUE']." г.в."); }
|
||||
if($arParams['PROPERTIES']['MILEAGE']['VALUE'] > 0) { array_push($description, "пробег ".$arParams['PROPERTIES']['MILEAGE']['VALUE']." км"); }
|
||||
if($arParams['PROPERTIES']['ENGINE_HOURS']['VALUE'] > 0) { array_push($description, $arParams['PROPERTIES']['ENGINE_HOURS']['VALUE']." м.ч."); }
|
||||
if(!empty($arParams['PROPERTIES']['PARKING_CITY']['VALUE'])) { array_push($description, $arParams['PROPERTIES']['PARKING_CITY']['VALUE']); }
|
||||
|
||||
?>
|
||||
<div class="catalog_item">
|
||||
<a href="/izt/<?= $arParams['CODE']; ?>/" class="item_link" area-label="<?= $arParams['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arParams['PROPERTIES']['MODEL']['RELATED']['NAME']; ?>"></a>
|
||||
<img class="used_item_img <?= $arParams['ACTIVE'] === "N" ? "car_used_sold" : ""; ?>" src="<?= !empty($arParams['PREVIEW_PICTURE']) ? $arParams['PREVIEW_PICTURE'] : "/images/no_image_500x300.png"; ?>" alt="<?= $arParams['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arParams['PROPERTIES']['MODEL']['RELATED']['NAME']; ?> <?= $arParams['PROPERTIES']['BODY']['VALUE']; ?>" />
|
||||
<p class="item_class used_item_number">Артикул: <?= $arParams['PROPERTIES']['CONTRACT']['VALUE']; ?></p>
|
||||
<div class="used_item_tags <?= $arParams['ACTIVE'] === "N" ? "car_used_sold" : ""; ?>">
|
||||
<? if($arParams['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0): ?>
|
||||
<div class="used_item_tag used_item_discount">Скидка</div>
|
||||
<? endif; ?>
|
||||
<? if($arParams['PROPERTIES']['SPECIAL_OFFER']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_special_offer">Спецпредложение</div>
|
||||
<? endif; ?>
|
||||
<? if(!empty($arParams['PROPERTIES']['RESERVE_DATE']['VALUE'])): ?>
|
||||
<div class="used_item_tag used_item_reserve">Резерв до <?= date("d.m.Y", strtotime($arParams['PROPERTIES']['RESERVE_DATE']['VALUE'])); ?></div>
|
||||
<? endif; ?>
|
||||
<? if($arParams['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_leasing">Доступно в лизинг</div>
|
||||
<? endif; ?>
|
||||
<? if($arParams['PROPERTIES']['AFTER_ACCIDENT']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_accident">После ДТП</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<p class="item_class <?= $arParams['ACTIVE'] === "N" ? "car_used_sold" : ""; ?>"><?= $arParams['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arParams['PROPERTIES']['MODEL']['RELATED']['NAME']; ?> <?= $arParams['PROPERTIES']['BODY']['VALUE']; ?></p>
|
||||
<p class="item_model <?= $arParams['ACTIVE'] === "N" ? "car_used_sold" : ""; ?>">
|
||||
<b><?= $arParams['PROPERTIES']['MODIFICATION']['VALUE']; ?></b>
|
||||
<?= implode(", ", $description); ?>
|
||||
</p>
|
||||
<? if($arParams['ACTIVE'] === "N"): ?>
|
||||
<br/>
|
||||
<p class="item_model" style="font-weight: 600; color: #B7391A;">Автомобиль продан</p>
|
||||
<? else: ?>
|
||||
<ul>
|
||||
<? if($arParams['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === 'YES'): ?>
|
||||
<li class="pay">
|
||||
<p>Ежемесячный платёж (от)</p>
|
||||
<p><?= $arParams['CALCULATION']['MONTHLY']; ?> р.</p>
|
||||
</li>
|
||||
<? endif; ?>
|
||||
<li>
|
||||
<p>Стоимость автомобиля</p>
|
||||
<? if($arParams['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0): ?>
|
||||
<p style="text-decoration: line-through;"><?= number_format($arParams['PROPERTIES']['PRICE']['VALUE'], 0, ".", " "); ?> р.</p>
|
||||
<? else: ?>
|
||||
<p><?= number_format($arParams['PROPERTIES']['PRICE']['VALUE'], 0, ".", " "); ?> р.</p>
|
||||
<? endif; ?>
|
||||
</li>
|
||||
<? if($arParams['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0): ?>
|
||||
<li>
|
||||
<p>Стоимость со скидкой</p>
|
||||
<p><?= number_format($arParams['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'], 0, ".", " "); ?> р.</p>
|
||||
</li>
|
||||
<? endif; ?>
|
||||
</ul>
|
||||
<? endif; ?>
|
||||
<div class="item_footer">
|
||||
<? if($arParams['ACTIVE'] === "Y"): ?>
|
||||
<span class="button button-blue">Подробнее</span>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<p></p>
|
||||
</div>
|
||||
@ -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,86 @@
|
||||
<?
|
||||
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 = [];
|
||||
$sort = Array("SORT" => "ASC", "NAME" => "ASC");
|
||||
$filter = Array("IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_USED, "CODE" => $arParams['OFFER']);
|
||||
$options = Array("nPageSize" => 1);
|
||||
|
||||
$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_USED, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS_USED, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
//$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(10, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
|
||||
$arParams['car_price'] = ($ar_res['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? $ar_res['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] : $ar_res['PROPERTIES']['PRICE']['VALUE']);
|
||||
|
||||
$ar_res['CALCULATION'] = (array) json_decode(file_get_contents("https://evoleasing.ru/api/calculation/"
|
||||
."?car_price=".$arParams['car_price']
|
||||
."&initial_payment=".$arParams['initial_payment']
|
||||
."&lease_period=".$arParams['lease_period']
|
||||
."&redemption_payment=".$arParams['redemption_payment'].""));
|
||||
|
||||
$arResult = $ar_res;
|
||||
|
||||
$arResult['PHOTOS_1080'] = [];
|
||||
$arResult['PHOTOS_480'] = [];
|
||||
$arResult['PHOTOS_120'] = [];
|
||||
|
||||
foreach($ar_res['PROPERTIES']['PHOTOS_1080']['VALUE'] AS $photo_id)
|
||||
{
|
||||
array_push($arResult['PHOTOS_1080'], CFile::GetPath($photo_id));
|
||||
}
|
||||
|
||||
foreach($ar_res['PROPERTIES']['PHOTOS_480']['VALUE'] AS $photo_id)
|
||||
{
|
||||
array_push($arResult['PHOTOS_480'], CFile::GetPath($photo_id));
|
||||
}
|
||||
|
||||
foreach($ar_res['PROPERTIES']['PHOTOS_120']['VALUE'] AS $photo_id)
|
||||
{
|
||||
array_push($arResult['PHOTOS_120'], CFile::GetPath($photo_id));
|
||||
}
|
||||
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="'.$ar_res['CANONICAL_PAGE_URL'].'"/>');
|
||||
//$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/used/'.$ar_res['PROPERTIES']['BRAND']['RELATED']['CODE'].'/'.$ar_res['PROPERTIES']['MODEL']['RELATED']['CODE'].'/"/>');
|
||||
}
|
||||
|
||||
if(empty($ar_res['NAME'])) { define('ERROR_404', 'Y'); }
|
||||
else
|
||||
{
|
||||
$APPLICATION->AddChainItem($ar_res['PROPERTIES']['BRAND']['RELATED']['NAME'], "/used/".$ar_res['PROPERTIES']['BRAND']['RELATED']['CODE']."/");
|
||||
$APPLICATION->AddChainItem($ar_res['PROPERTIES']['MODEL']['RELATED']['NAME'], "/used/".$ar_res['PROPERTIES']['BRAND']['RELATED']['CODE']."/".$ar_res['PROPERTIES']['MODEL']['RELATED']['CODE']."/");
|
||||
$APPLICATION->AddChainItem($ar_res["NAME"]);
|
||||
|
||||
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($ar_res['IBLOCK_ID'], $ar_res["ID"]);
|
||||
$meta = $ipropValues->getValues();
|
||||
$APPLICATION->SetPageProperty("title", $meta['ELEMENT_META_TITLE']);
|
||||
$APPLICATION->SetPageProperty("keywords", $meta['ELEMENT_META_KEYWORDS']);
|
||||
$APPLICATION->SetPageProperty("description", $meta['ELEMENT_META_DESCRIPTION']);
|
||||
}
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$MESS ['DEFAULT_NAME'] = "Список специальных приложений";
|
||||
$MESS ['DEFAULT_DESC'] = "Список специальных приложений";
|
||||
?>
|
||||
@ -0,0 +1,419 @@
|
||||
var calculation = { car_price: 0, CAR_PRICE_MIN: 0, CAR_PRICE_MAX: 0, initial_payment: 0, lease_period: 0, monthly_payment: 0, redemption_payment: 0, tax_savings: 0, vat_reimbursement: 0 };
|
||||
var calculation_default = {};
|
||||
var current_image = 0;
|
||||
var max_images = 0;
|
||||
var photos = {};
|
||||
var fullscreen = false;
|
||||
|
||||
let touchstartX = 0;
|
||||
let touchstartY = 0;
|
||||
let touchendX = 0;
|
||||
let touchendY = 0;
|
||||
|
||||
console.log({ calculation });
|
||||
|
||||
function calculator(props)
|
||||
{
|
||||
for(let i in calculation)
|
||||
{
|
||||
calculation[i] = parseInt(props[i], 10);
|
||||
}
|
||||
|
||||
$("#FORM_FIELD_PRICE").val(calculation.car_price);
|
||||
$("#FORM_FIELD_PREPAID").val(calculation.initial_payment);
|
||||
$("#FORM_FIELD_TERM").val(calculation.lease_period);
|
||||
$("#FORM_FIELD_REDEMPTION").val(calculation.redemption_payment);
|
||||
|
||||
calculation_default = { ...calculation };
|
||||
}
|
||||
|
||||
function calculate(param, value)
|
||||
{
|
||||
if(param !== undefined)
|
||||
{
|
||||
calculation[param] = value;
|
||||
}
|
||||
|
||||
$("#FORM_FIELD_PRICE").val(calculation.car_price);
|
||||
$("#FORM_FIELD_PREPAID").val(calculation.initial_payment);
|
||||
$("#FORM_FIELD_TERM").val(calculation.lease_period);
|
||||
$("#FORM_FIELD_REDEMPTION").val(calculation.redemption_payment);
|
||||
|
||||
$.post("/api/calculation/",
|
||||
{
|
||||
car_price: calculation.car_price,
|
||||
initial_payment: calculation.initial_payment,
|
||||
lease_period: calculation.lease_period,
|
||||
redemption_payment: calculation.redemption_payment,
|
||||
}, function(response)
|
||||
{
|
||||
for(let i in response) { calculation[i] = parseInt(response[i], 10); }
|
||||
|
||||
$("#calculator_car_price_value").text(calculation['car_price'].toLocaleString()+" ₽");
|
||||
$("#calculator_monthly_payment_value").text(calculation['monthly_payment'].toLocaleString());
|
||||
$("#calculator_tax_savings_value").text(calculation['tax_savings'].toLocaleString());
|
||||
$("#calculator_vat_reimbursement_value").text(calculation['vat_reimbursement'].toLocaleString());
|
||||
}, "json");
|
||||
}
|
||||
|
||||
$("#calculation_reset").on("click", function()
|
||||
{
|
||||
console.log("calculation_reset");
|
||||
console.log(calculation_default);
|
||||
|
||||
calculation = { ...calculation_default };
|
||||
|
||||
var $input_range_car_price = $(`#calculation_car_price`);
|
||||
$input_range_car_price.val(calculation['car_price']).change();
|
||||
$("#calculator_car_price_value").text(calculation['car_price'].toLocaleString()+" ₽");
|
||||
|
||||
var $input_range_car_price = $(`#calculation_initial_payment`);
|
||||
$input_range_car_price.val(calculation['initial_payment']).change();
|
||||
|
||||
var $input_range_car_price = $(`#calculation_lease_period`);
|
||||
$input_range_car_price.val(calculation['lease_period']).change();
|
||||
|
||||
var $input_range_car_price = $(`#calculation_redemption_payment`);
|
||||
$input_range_car_price.val(calculation['redemption_payment']).change();
|
||||
});
|
||||
|
||||
$(".car_details_menu").on("click", function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
$(".car_details_menu").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
|
||||
$(".info_block").removeClass("active");
|
||||
$("#info_block_"+$(this).data("id")).addClass("active");
|
||||
});
|
||||
|
||||
$(".touch_header").on("click", function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
$(this).toggleClass("opened");
|
||||
$(this).parent().toggleClass("active");
|
||||
});
|
||||
|
||||
function calculator_car_price_save()
|
||||
{
|
||||
var v = parseInt($("#calculator_car_price_input").val(), 10);
|
||||
console.log(v, calculation['CAR_PRICE_MIN'], calculation['CAR_PRICE_MAX']);
|
||||
if(v >= calculation['CAR_PRICE_MIN'] && v <= calculation['CAR_PRICE_MAX'])
|
||||
{
|
||||
var $input_range_car_price = $(`#calculation_car_price`);
|
||||
$input_range_car_price.val(v).change();
|
||||
calculate('car_price', v);
|
||||
|
||||
$("#calculator_car_price_value").show();
|
||||
$("#calculator_car_price_editor").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#calculator_car_price_value").show();
|
||||
$("#calculator_car_price_editor").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function fullpage_prev()
|
||||
{
|
||||
if(fullscreen && current_image > 0)
|
||||
{
|
||||
$(".photo_480_"+current_image).animate({ opacity: 0.0, }, 500);
|
||||
current_image--;
|
||||
$(".photo_480_"+current_image).animate({ opacity: 1.0, }, 500);
|
||||
|
||||
if(current_image === 0)
|
||||
{
|
||||
$("#overlay_left").css("display", "none");
|
||||
}
|
||||
$("#overlay_right").css("display", "flex");
|
||||
$("#overlay_image").attr("src", photos['1080'][current_image]);
|
||||
}
|
||||
}
|
||||
|
||||
function fullpage_next()
|
||||
{
|
||||
console.log("fullpage_next()");
|
||||
if(fullscreen && current_image < max_images)
|
||||
{
|
||||
$(".photo_480_"+current_image).animate({ opacity: 0.0, }, 500);
|
||||
current_image++;
|
||||
$(".photo_480_"+current_image).animate({ opacity: 1.0, }, 500);
|
||||
|
||||
if(current_image === max_images)
|
||||
{
|
||||
$("#overlay_right").css("display", "none");
|
||||
}
|
||||
$("#overlay_left").css("display", "flex");
|
||||
$("#overlay_image").attr("src", photos['1080'][current_image]);
|
||||
}
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
var $document = $(document);
|
||||
var selector = '[data-rangeslider]';
|
||||
var $element = $(selector);
|
||||
|
||||
photos = JSON.parse($("#photos").val());
|
||||
max_images = photos['1080'].length - 1;
|
||||
|
||||
// For ie8 support
|
||||
var textContent = ('textContent' in document) ? 'textContent' : 'innerText';
|
||||
|
||||
// Example functionality to demonstrate a value feedback
|
||||
function valueOutput(element)
|
||||
{
|
||||
var value = element.value;
|
||||
var output = element.parentNode.getElementsByTagName('output')[0] || element.parentNode.parentNode.getElementsByTagName('output')[0];
|
||||
output[textContent] = value;
|
||||
}
|
||||
|
||||
$document.on('input', 'input[type="range"], ' + selector, function(e)
|
||||
{
|
||||
valueOutput(e.target);
|
||||
});
|
||||
|
||||
$document.on('click', '#js-example-disabled button[data-behaviour="toggle"]', function(e)
|
||||
{
|
||||
var $inputRange = $(selector, e.target.parentNode);
|
||||
|
||||
if ($inputRange[0].disabled) {
|
||||
$inputRange.prop("disabled", false);
|
||||
}
|
||||
else {
|
||||
$inputRange.prop("disabled", true);
|
||||
}
|
||||
$inputRange.rangeslider('update');
|
||||
});
|
||||
|
||||
$document.on('click', '#js-example-change-value button', function(e) {
|
||||
var $inputRange = $(selector, e.target.parentNode);
|
||||
var value = $('input[type="number"]', e.target.parentNode)[0].value;
|
||||
|
||||
$inputRange.val(value).change();
|
||||
});
|
||||
|
||||
$document.on('click', '#js-example-change-attributes button', function(e)
|
||||
{
|
||||
var $inputRange = $(selector, e.target.parentNode);
|
||||
var attributes = {
|
||||
min: $('input[name="min"]', e.target.parentNode)[0].value,
|
||||
max: $('input[name="max"]', e.target.parentNode)[0].value,
|
||||
step: $('input[name="step"]', e.target.parentNode)[0].value
|
||||
};
|
||||
|
||||
$inputRange.attr(attributes);
|
||||
$inputRange.rangeslider('update', true);
|
||||
});
|
||||
|
||||
$document
|
||||
.on('click', '#js-example-destroy button[data-behaviour="destroy"]', function(e) {
|
||||
$(selector, e.target.parentNode).rangeslider('destroy');
|
||||
})
|
||||
.on('click', '#js-example-destroy button[data-behaviour="initialize"]', function(e) {
|
||||
$(selector, e.target.parentNode).rangeslider({ polyfill: false });
|
||||
});
|
||||
|
||||
$document.on('click', '#js-example-hidden button[data-behaviour="toggle"]', function(e) {
|
||||
var $container = $(e.target.previousElementSibling);
|
||||
$container.toggle();
|
||||
});
|
||||
|
||||
$element.rangeslider({
|
||||
polyfill: false,
|
||||
onInit: function()
|
||||
{
|
||||
valueOutput(this.$element[0]);
|
||||
},
|
||||
onSlide: function(position, value)
|
||||
{
|
||||
if(this.$element.attr('data-slider-name') === "car_price")
|
||||
{
|
||||
$("#calculator_car_price_value").text(value.toLocaleString()+" ₽");
|
||||
}
|
||||
},
|
||||
onSlideEnd: function(position, value)
|
||||
{
|
||||
calculate(this.$element.attr('data-slider-name'), value);
|
||||
}
|
||||
});
|
||||
|
||||
$("#calculator_car_price_value").on("click", function()
|
||||
{
|
||||
$("#calculator_car_price_input").val(parseInt(calculation.car_price, 10));
|
||||
$("#calculator_car_price_value").hide();
|
||||
$("#calculator_car_price_editor").show();
|
||||
});
|
||||
|
||||
$("#calculator_car_price_save").on("click", function()
|
||||
{
|
||||
calculator_car_price_save();
|
||||
});
|
||||
|
||||
$("#calculator_car_price_input").on("keydown", function(event)
|
||||
{
|
||||
if(event.keyCode === 13)
|
||||
{
|
||||
event.preventDefault();
|
||||
calculator_car_price_save();
|
||||
}
|
||||
});
|
||||
|
||||
$("#to_calculator_button").on("click", function(event)
|
||||
{
|
||||
leasing_form_used_buy = false;
|
||||
$(".order_title").text("Оформить автомобиль с пробегом в лизинг");
|
||||
$("#form_leasing_used_email").attr("href", "mailto:buy@evoleasing.ru").text("buy@evoleasing.ru");
|
||||
$("#FORM_FIELD_IS_IZT").val("");
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $("#calc").offset().top - 100
|
||||
}, 200);
|
||||
});
|
||||
|
||||
$("#to_form_button").on("click", function(event)
|
||||
{
|
||||
leasing_form_used_buy = true;
|
||||
$(".order_title").text("Купить автомобиль с пробегом");
|
||||
$("#form_leasing_used_email").attr("href", "mailto:izt@evoleasing.ru").text("izt@evoleasing.ru");
|
||||
$("#FORM_FIELD_IS_IZT").val("Да");
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $("#order").offset().top - 100
|
||||
}, 200);
|
||||
});
|
||||
|
||||
$("#to_used_catalog_button").on("click", function(event)
|
||||
{
|
||||
document.location.href = "/used/";
|
||||
});
|
||||
|
||||
$(".thumb").eq(0).addClass("active");
|
||||
$(".thumb").on("click", function(event)
|
||||
{
|
||||
var new_image = $(this).data("index");
|
||||
if(current_image !== new_image)
|
||||
{
|
||||
$(".photo_480_"+current_image).animate({ opacity: 0.0, }, 500);
|
||||
$(".photo_480_"+new_image).animate({ opacity: 1.0, }, 500);
|
||||
$(this).addClass("active").siblings().removeClass("active");
|
||||
current_image = new_image;
|
||||
}
|
||||
});
|
||||
|
||||
$(".photo_480").on("click", function(event)
|
||||
{
|
||||
var url = photos['1080'][current_image];
|
||||
|
||||
$("#overlay_image").attr("src", url);
|
||||
if(current_image > 0)
|
||||
{
|
||||
$("#overlay_left").css("display", "flex");
|
||||
}
|
||||
|
||||
if(current_image < max_images)
|
||||
{
|
||||
$("#overlay_right").css("display", "flex");
|
||||
}
|
||||
|
||||
$("body").css("overflow", "hidden");
|
||||
$("#fullscreen").css("display", "flex");
|
||||
fullscreen = true;
|
||||
|
||||
touchstartX = 0;
|
||||
touchstartY = 0;
|
||||
touchendX = 0;
|
||||
touchendY = 0;
|
||||
console.log("INIT");
|
||||
});
|
||||
|
||||
$("#overlay_close").on("click", function(event)
|
||||
{
|
||||
$("#fullscreen").css("display", "none");
|
||||
$("#overlay_left").css("display", "none");
|
||||
$("#overlay_right").css("display", "none");
|
||||
$("body").css("overflow", "inherit");
|
||||
fullscreen = false;
|
||||
});
|
||||
|
||||
$("#overlay_left").on("click", function(event)
|
||||
{
|
||||
fullpage_prev();
|
||||
});
|
||||
|
||||
$("#overlay_right").on("click", function(event)
|
||||
{
|
||||
fullpage_next();
|
||||
});
|
||||
|
||||
$("#pdf_download").on("click", function(event)
|
||||
{
|
||||
var contract = $("#contract").val();
|
||||
|
||||
$.ajax({
|
||||
url: '/api/catalog/pdf/',
|
||||
method: 'GET',
|
||||
data: {
|
||||
contract
|
||||
},
|
||||
xhrFields: { responseType: 'arraybuffer'}
|
||||
}).then(function (data)
|
||||
{
|
||||
var blob = new Blob([data], { type:"application/pdf" });
|
||||
var link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = "evoleasing_offer_"+contract+".pdf";
|
||||
link.click();
|
||||
});
|
||||
});
|
||||
|
||||
$("body").keydown(function(e)
|
||||
{
|
||||
if(e.keyCode == 37)
|
||||
{
|
||||
fullpage_prev();
|
||||
}
|
||||
else if(e.keyCode == 39)
|
||||
{
|
||||
fullpage_next();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const gestureZone = document.getElementById('overlay_image');
|
||||
|
||||
gestureZone.addEventListener('touchstart', function(event) {
|
||||
touchstartX = event.changedTouches[0].screenX;
|
||||
touchstartY = event.changedTouches[0].screenY;
|
||||
}, false);
|
||||
|
||||
gestureZone.addEventListener('touchend', function(event) {
|
||||
touchendX = event.changedTouches[0].screenX;
|
||||
touchendY = event.changedTouches[0].screenY;
|
||||
handleGesture();
|
||||
}, false);
|
||||
|
||||
function handleGesture() {
|
||||
if (touchendX < touchstartX) {
|
||||
fullpage_next();
|
||||
console.log('<< LEFT');
|
||||
}
|
||||
|
||||
if (touchendX > touchstartX) {
|
||||
fullpage_prev();
|
||||
console.log('RIGHT >>');
|
||||
}
|
||||
|
||||
if (touchendY < touchstartY) {
|
||||
console.log('Swiped up');
|
||||
}
|
||||
|
||||
if (touchendY > touchstartY) {
|
||||
console.log('Swiped down');
|
||||
}
|
||||
|
||||
if (touchendY === touchstartY) {
|
||||
console.log('Tap');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,332 @@
|
||||
.scroll_images {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: -webkit-box;
|
||||
flex-wrap: nowrap;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-behavior: smooth;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
gap: 0 2px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
.scroll_images {
|
||||
margin: 2px -16px;
|
||||
width: calc(100% + 32px);
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.model_container .col .scroll_images img,
|
||||
.scroll_images img {
|
||||
margin: 0;
|
||||
min-width: 100%;
|
||||
min-height: 100%;
|
||||
height: inherit;
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) and (max-width: 1024px) {
|
||||
.scroll_images {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 15px;
|
||||
gap: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.thumb {
|
||||
display: flex;
|
||||
width: 33.333%;
|
||||
margin: 2px 0px 8px 0px;
|
||||
margin-right: 0;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
border: 2px solid #fff;
|
||||
transition: border 175ms ease;
|
||||
height: 120px;
|
||||
max-width: 160px;
|
||||
min-width: 160px;
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) and (max-width: 1024px) {
|
||||
.thumb {
|
||||
width: 33.333%;
|
||||
height: auto;
|
||||
margin-bottom: 0px;
|
||||
min-width: 0;
|
||||
max-width: unset;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
.thumb {
|
||||
width: auto;
|
||||
min-width: 90px;
|
||||
height: 88px;
|
||||
}
|
||||
}
|
||||
|
||||
.thumb img {
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
.thumb.active {
|
||||
border: 2px solid var(--blue);
|
||||
}
|
||||
|
||||
.thumb_image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#photo_480 {
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.photo_480 {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#photo_480_wrapper {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
#photo_480_wrapper {
|
||||
margin: 0 -16px;
|
||||
width: calc(100% + 32px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.photo_480 {
|
||||
max-width: 100% !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
#fullscreen {
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: none;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
z-index: 1000;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#overlay {
|
||||
opacity: 0.9;
|
||||
background-color: black;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
#overlay_image {
|
||||
height: auto;
|
||||
z-index: 1001;
|
||||
touch-action:pan-x;
|
||||
}
|
||||
|
||||
@media screen and (orientation:portrait) {
|
||||
#overlay_image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (orientation:landscape) {
|
||||
#overlay_image {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#overlay_close {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 25px;
|
||||
background-color: #1c01a9;
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
right: 25px;
|
||||
z-index: 1002;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#overlay_close_icon {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
background-image: url("/images/icons/close-white.svg");
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
#overlay_left {
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
background-color: #1c01a9;
|
||||
z-index: 1001;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#overlay_left_icon {
|
||||
background-image: url("/images/icons/slider_arrow.svg");
|
||||
width: 25px;
|
||||
height: 16px;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
#overlay_right {
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
background-color: #1c01a9;
|
||||
z-index: 1001;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#overlay_right_icon {
|
||||
background-image: url("/images/icons/slider_arrow.svg");
|
||||
width: 25px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
#pdf_download {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
cursor: pointer;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
.model_desc {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#pdf_download {
|
||||
/*position: absolute;*/
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
width: min-content;
|
||||
margin: 15px 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) and (max-width: 1280px) {
|
||||
#pdf_download {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
#pdf_download p {
|
||||
width: 60%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
line-height: 16px;
|
||||
margin-left: 10px;
|
||||
color: #a8026b;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#pdf_icon {
|
||||
background-image: url("/images/icons/icon-pdf.svg");
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.used_item_tags {
|
||||
display: flow-root;
|
||||
margin-bottom: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.used_item_tag {
|
||||
font-size: 10px;
|
||||
color: white;
|
||||
width: fit-content;
|
||||
margin-right: 4px;
|
||||
margin-bottom: 4px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.used_item_special_offer {
|
||||
background-color: #a8026b;
|
||||
}
|
||||
|
||||
.used_item_reserve {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.used_item_discount {
|
||||
background-color: #04a8a4;
|
||||
}
|
||||
|
||||
.used_item_leasing {
|
||||
background-color: #1c01a9;
|
||||
}
|
||||
|
||||
.used_item_accident {
|
||||
background-color: #9e9e9e;
|
||||
}
|
||||
|
||||
.scroll_images_button {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 25px;
|
||||
background-color: #1c01a9;
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.scroll_images_button_left {
|
||||
left: 0px;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.scroll_images_button_right {
|
||||
right: 0px;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.car_container_used {
|
||||
margin-top: 30px!important;
|
||||
}
|
||||
@ -0,0 +1,349 @@
|
||||
<?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);
|
||||
?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
calculator(<?= CUtil::PhpToJSObject(array_merge(gettype($arParams) === "array" ? $arParams : [], gettype($arResult['CALCULATION']) === "array" ? $arResult['CALCULATION'] : [] )); ?>);
|
||||
<? if($arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] !== "YES"): ?>
|
||||
$("#FORM_FIELD_IS_IZT").val("Да");
|
||||
<? endif; ?>
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
main {overflow-x: unset;}
|
||||
</style>
|
||||
<section data-page="position">
|
||||
<input type="hidden" id="FORM_FIELD_BRAND" value="<?= $arResult['PROPERTIES']['BRAND']['RELATED']['NAME']; ?>"/>
|
||||
<input type="hidden" id="FORM_FIELD_MODEL" value="<?= $arResult['PROPERTIES']['MODEL']['RELATED']['NAME']; ?>"/>
|
||||
<input type="hidden" id="FORM_FIELD_MODIFICATION" value="<?= $arResult['PROPERTIES']['MODIFICATION']['RELATED']['PROPERTIES']['TITLE']['VALUE']; ?>"/>
|
||||
<input type="hidden" id="FORM_FIELD_PRICE" value=""/>
|
||||
<input type="hidden" id="FORM_FIELD_PREPAID" value=""/>
|
||||
<input type="hidden" id="FORM_FIELD_TERM" value=""/>
|
||||
<input type="hidden" id="FORM_FIELD_REDEMPTION" value=""/>
|
||||
<div class="container">
|
||||
<ul class="breadcrumbs">
|
||||
<li></li>
|
||||
</ul>
|
||||
<h1 class="car_position_title"><em><?= $arResult['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arResult['PROPERTIES']['MODEL']['RELATED']['NAME']; ?></em><br> <?= $arResult['PROPERTIES']['MODIFICATION']['VALUE']; ?> с пробегом<?= $arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === "YES" ? " в лизинг " : " "; ?>для юридических лиц и ИП</h1>
|
||||
<div class="used_item_tags">
|
||||
<? if($arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0): ?>
|
||||
<div class="used_item_tag used_item_discount">Скидка</div>
|
||||
<? endif; ?>
|
||||
<? if($arResult['PROPERTIES']['SPECIAL_OFFER']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_special_offer">Спецпредложение</div>
|
||||
<? endif; ?>
|
||||
<? if(!empty($arResult['PROPERTIES']['RESERVE_DATE']['VALUE'])): ?>
|
||||
<div class="used_item_tag used_item_reserve">Резерв до <?= date("d.m.Y", strtotime($arResult['PROPERTIES']['RESERVE_DATE']['VALUE'])); ?></div>
|
||||
<? endif; ?>
|
||||
<? if($arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_leasing">Доступно в лизинг</div>
|
||||
<? endif; ?>
|
||||
<? if($arResult['PROPERTIES']['AFTER_ACCIDENT']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_accident">После ДТП</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<div class="model_container car_container_used">
|
||||
<div class="col">
|
||||
<input type="hidden" id="photos" value='<?= json_encode([
|
||||
"120" => $arResult['PHOTOS_120'],
|
||||
"480" => $arResult['PHOTOS_480'],
|
||||
"1080" => $arResult['PHOTOS_1080'],
|
||||
]); ?>'/>
|
||||
<input type="hidden" id="contract" value="<?= $arResult['CODE']; ?>"/>
|
||||
<div id="photo_480_wrapper">
|
||||
<? if(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): ?>
|
||||
<img
|
||||
class="photo_480 photo_480_<?= $k; ?>"
|
||||
data-p1080="<?= !empty($arResult['PHOTOS_1080'][$k]) ? $arResult['PHOTOS_1080'][$k] : ""; ?>"
|
||||
src="<?= $photo_480; ?>"
|
||||
alt="<?= $arResult['NAME']; ?>"
|
||||
width="100%" height="auto"
|
||||
style="<?= $k === 0 ? "opacity: 1.0;" : "opacity: 0.0;"; ?>
|
||||
">
|
||||
<? endforeach; ?>
|
||||
<? endif; ?>
|
||||
<? else: ?>
|
||||
<img id="photo_480" src="/images/no_image_650.png" alt="<?= $arResult['NAME']; ?>" width="100%" height="auto">
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<?/* style="display:none;" */?>
|
||||
<div style="position: relative;">
|
||||
<div class="scroll_images_button scroll_images_button_left"></div>
|
||||
<div class="scroll_images" data-custom-scroll="true">
|
||||
<? foreach($arResult['PHOTOS_120'] AS $k => $thumb): ?>
|
||||
<div class="thumb" data-p480="<?= $arResult['PHOTOS_480'][$k]; ?>" data-p1080="<?= $arResult['PHOTOS_1080'][$k]; ?>" data-index="<?= $k; ?>">
|
||||
<img class="thumb_image" src="<?= $thumb; ?>" alt="<?= $arResult['NAME']; ?>">
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
<div class="scroll_images_button scroll_images_button_right"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="model_desc">
|
||||
<p><b>Артикул: <?= $arResult['CODE']; ?></b></p>
|
||||
<? if(!empty($arResult['PROPERTIES']['VIN']['VALUE'])): ?>
|
||||
<p><b>VIN: <?= str_repeat("*", 12).substr($arResult['PROPERTIES']['VIN']['VALUE'], 12, 5); ?></b></p>
|
||||
<? endif; ?>
|
||||
<p><b>Ключевые характеристики</b></p>
|
||||
<ul class="list-column">
|
||||
<li>Год выпуска: <?= $arResult['PROPERTIES']['YEAR']['VALUE']; ?></li>
|
||||
<? if(!empty($arResult['PROPERTIES']['MILEAGE']['VALUE'])): ?>
|
||||
<li>Пробег: <?= $arResult['PROPERTIES']['MILEAGE']['VALUE']; ?> км.</li>
|
||||
<? endif; ?>
|
||||
<? if(!empty($arResult['PROPERTIES']['ENGINE_HOURS']['VALUE'])): ?>
|
||||
<li>Моточасы: <?= $arResult['PROPERTIES']['ENGINE_HOURS']['VALUE']; ?></li>
|
||||
<? endif; ?>
|
||||
<? if(!empty($arResult['PROPERTIES']['ENGINE_POWER']['VALUE'])): ?>
|
||||
<li>Л.с.: <?= $arResult['PROPERTIES']['ENGINE_POWER']['VALUE']; ?></li>
|
||||
<? endif; ?>
|
||||
<li>Объем: <?= $arResult['PROPERTIES']['ENGINE_VOLUME']['VALUE']; ?></li>
|
||||
<li>Топливо: <?= $arResult['PROPERTIES']['ENGINE_FUEL']['VALUE']; ?></li>
|
||||
<? if(!empty($arResult['PROPERTIES']['PARKING_REGION']['VALUE'])): ?>
|
||||
<li>Регион размещения: <?= $arResult['PROPERTIES']['PARKING_REGION']['VALUE']; ?></li>
|
||||
<? endif; ?>
|
||||
<? if(!empty($arResult['PROPERTIES']['PARKING_CITY']['VALUE'])): ?>
|
||||
<li>Город размещения: <?= $arResult['PROPERTIES']['PARKING_CITY']['VALUE']; ?></li>
|
||||
<? endif; ?>
|
||||
</ul>
|
||||
<? if($arResult['ACTIVE'] == "Y"): ?>
|
||||
<div id="pdf_download">
|
||||
<div id="pdf_icon"></div>
|
||||
<p>Скачать PDF с коммерческим предложением</p>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<div class="fixed_col" style="z-index: 10;">
|
||||
<div class="model_price">
|
||||
<? if($arResult['ACTIVE'] == "Y"): ?>
|
||||
<h2 style="margin:0; font-size:inherit; margin-bottom: 45px; line-height: 20px;">Приобретите <?= $arResult['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arResult['PROPERTIES']['MODEL']['RELATED']['NAME']; ?> на выгодных условиях</h2>
|
||||
<p style="<?= $arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? "text-decoration: line-through; margin-bottom: 20px;" : ""; ?>">
|
||||
Стоимость авто
|
||||
<span style="font-size: <?= ($arResult['PROPERTIES']['PRICE']['VALUE'] > 9999999) ? "30px" : "34px"; ?>"><?= number_format($arResult['PROPERTIES']['PRICE']['VALUE'], 0, ".", " "); ?> ₽</span>
|
||||
</p>
|
||||
<? if($arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0): ?>
|
||||
<p>
|
||||
Стоимость авто со скидкой
|
||||
<span style="font-size: <?= ($arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 9999999) ? "30px" : "34px"; ?>"><?= number_format($arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'], 0, ".", " "); ?> ₽</span>
|
||||
</p>
|
||||
<? endif; ?>
|
||||
<button class="button button-blue" id="to_form_button">Купить</button>
|
||||
<? if($arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === 'YES'): ?>
|
||||
<button class="button" id="to_calculator_button">Оформить в лизинг</button>
|
||||
<? endif; ?>
|
||||
<? else: ?>
|
||||
<p style="margin: 0; font-size: 24px; margin-bottom: 45px; line-height: 24px; color: #B7391A;">Автомобиль продан</p>
|
||||
<p style="font-weight: normal;">
|
||||
Посмотрите другие автомобили с пробегом в нашем каталоге
|
||||
</p>
|
||||
<button class="button" id="to_used_catalog_button">Посмотреть каталог</button>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aside_container">
|
||||
<aside>
|
||||
<ul class="aside_nav">
|
||||
<li>
|
||||
<a href="#" data-id="1" class="car_details_menu active"><h2 style="margin:0; font-size:inherit; font-weight:inherit;">Комплектация</h2></a>
|
||||
</li>
|
||||
<? /*
|
||||
<li>
|
||||
<a href="#" data-id="2" class="car_details_menu"><h2 style="margin:0; font-size:inherit; font-weight:inherit;">Характеристики</h2></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-id="3" class="car_details_menu"><h2 style="margin:0; font-size:inherit; font-weight:inherit;">Обслуживание</h2></a>
|
||||
</li>
|
||||
*/ ?>
|
||||
</ul>
|
||||
</aside>
|
||||
<article>
|
||||
<div class=" active">
|
||||
</div>
|
||||
<div class="tab_content info_block info_column active" id="info_block_1">
|
||||
<?= $arResult['DETAIL_TEXT']; ?>
|
||||
<br/>
|
||||
</div>
|
||||
<?
|
||||
/*
|
||||
<div class="dropdown_blocks_list">
|
||||
<div class="dropdown_block open">
|
||||
<div class="block_header">
|
||||
<p>Лизинговые термины</p>
|
||||
<button class="block_toggle"></button>
|
||||
</div>
|
||||
<div class="block_body">
|
||||
<p>Амортизационные отчисления – отчисление, которые производятся каждый месяц в течение действия договора лизинга. Амортизационные отчисления производятся в сумме, не превышающей разницу между стоимостью предмета лизинга, указанной в договоре и его выкупной (остаточной) стоимостью, определяемой условиями лизингового контракта.</p>
|
||||
<p>
|
||||
<b>Банкротство лизингодателя</b><br>
|
||||
Банкротство лизинговой компании не является поводом для изъятия у лизингополучателя объекта лизинга, при условии, что последний не нарушил условия договора лизинга.</p>
|
||||
<p>
|
||||
<b>Внутренний лизинг</b><br>
|
||||
Лизинг, при котором всё стороны договора лизинга являются резиденты Республики Беларусь.</p>
|
||||
<ul class="list-column" data-column="2">
|
||||
<li>2021</li>
|
||||
<li>Красный рубеллит металлик </li>
|
||||
<li>8 Airbags </li>
|
||||
<li>ABS</li>
|
||||
<li>ESP</li>
|
||||
<li>светодиодные фары</li>
|
||||
<li>ц/замок</li>
|
||||
<li>эл/стекла</li>
|
||||
<li>эл/сиденья</li>
|
||||
<li>Электропривод зеркал</li>
|
||||
<li>Датчик дождя</li>
|
||||
<li>Панорамная крыша</li>
|
||||
<li>Пневмоподвеска</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown_block">
|
||||
<div class="block_header">
|
||||
<p>Лизинговые термины</p>
|
||||
<button></button>
|
||||
</div>
|
||||
<div class="block_body"></div>
|
||||
</div>
|
||||
<div class="dropdown_block">
|
||||
<div class="block_header">
|
||||
<p>Какие транспортные средства можно приобрести в лизинг? </p>
|
||||
<button></button>
|
||||
</div>
|
||||
<div class="block_body"></div>
|
||||
</div>
|
||||
<div class="dropdown_block">
|
||||
<div class="block_header">
|
||||
<p>Кто может стать поставщиком в лизинговой сделке?</p>
|
||||
<button></button>
|
||||
</div>
|
||||
<div class="block_body"></div>
|
||||
</div>
|
||||
<div class="dropdown_block">
|
||||
<div class="block_header">
|
||||
<p>Схема прохождения лизинговой сделки </p>
|
||||
<button></button>
|
||||
</div>
|
||||
<div class="block_body"></div>
|
||||
</div>
|
||||
</div>
|
||||
*/
|
||||
?>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<? if($arResult['ACTIVE'] == "Y" && $arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === 'YES'): ?>
|
||||
<div id="calc">
|
||||
<div class="calc_body">
|
||||
<h2 class="section_title">Калькулятор расчета лизинга</h2>
|
||||
<div class="calc_settings">
|
||||
<div class="settings_box">
|
||||
<p>Стоимость авто</p>
|
||||
<p>
|
||||
<span id="calculator_car_price_value">
|
||||
<?= number_format($arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? $arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] : $arResult['PROPERTIES']['PRICE']['VALUE'], 0, ".", " "); ?> ₽
|
||||
</span>
|
||||
<output hidden></output>
|
||||
</p>
|
||||
<div class="price_custom" id="calculator_car_price_editor" style="display:none;">
|
||||
<input id="calculator_car_price_input" type="number" value="500000" min="500000" max="20000000" />
|
||||
<button id="calculator_car_price_save">Сохранить</button>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input id="calculation_car_price" data-slider-name="car_price" type="range" min="<?= $arParams['CAR_PRICE_MIN']; ?>" max="<?= $arParams['CAR_PRICE_MAX']; ?>" step="100000" data-rangeslider value="<?= $arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? $arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] : $arResult['PROPERTIES']['PRICE']['VALUE']; ?>" />
|
||||
</div>
|
||||
<p class="min"><?= $arParams['CAR_PRICE_MIN'] / 1000000; ?> млн</p>
|
||||
<p class="max"><?= $arParams['CAR_PRICE_MAX'] / 1000000; ?> млн</p>
|
||||
</div>
|
||||
<div class="settings_box">
|
||||
<p>Первоначальный взнос</p>
|
||||
<p><output></output> %</p>
|
||||
<div class="line">
|
||||
<input id="calculation_initial_payment" data-slider-name="initial_payment" type="range" min="<?= $arParams['INITIAL_PAYMENT_MIN'];?>" max="<?= $arParams['INITIAL_PAYMENT_MAX'];?>" data-rangeslider value="<?= $arParams['initial_payment']; ?>" />
|
||||
</div>
|
||||
<p class="min"><?= $arParams['INITIAL_PAYMENT_MIN'];?>%</p>
|
||||
<p class="max"><?= $arParams['INITIAL_PAYMENT_MAX'];?>%</p>
|
||||
</div>
|
||||
<div class="settings_box">
|
||||
<p>Срок договора</p>
|
||||
<p><output></output> мес.</p>
|
||||
<div class="line">
|
||||
<input id="calculation_lease_period" data-slider-name="lease_period" type="range" min="<?= $arParams['LEASE_PERIOD_MIN']; ?>" max="<?= $arParams['LEASE_PERIOD_MAX']; ?>" data-rangeslider value="<?= $arParams['lease_period']; ?>" />
|
||||
</div>
|
||||
<p class="min"><?= $arParams['LEASE_PERIOD_MIN']; ?> мес.</p>
|
||||
<p class="max"><?= $arParams['LEASE_PERIOD_MAX']; ?> мес.</p>
|
||||
</div>
|
||||
<div class="settings_box">
|
||||
<p>Выкупной платеж</p>
|
||||
<p><output></output> %</p>
|
||||
<div class="line">
|
||||
<input id="calculation_redemption_payment" data-slider-name="redemption_payment" type="range" min="<?= $arParams['REDEMPTION_PAYMENT_MIN']; ?>" max="<?= $arParams['REDEMPTION_PAYMENT_MAX']; ?>" data-rangeslider value="<?= $arParams['redemption_payment']; ?>" />
|
||||
</div>
|
||||
<p class="min"><?= $arParams['REDEMPTION_PAYMENT_MIN']; ?>%</p>
|
||||
<p class="max"><?= $arParams['REDEMPTION_PAYMENT_MAX']; ?>%</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="calc_result">
|
||||
<div class="result_box bolder">
|
||||
<p>Ежемесячный платеж</p>
|
||||
<p><span id="calculator_monthly_payment_value"><?= number_format($arResult['CALCULATION']['monthly_payment'], 0, '.', ' '); ?></span> ₽</p>
|
||||
</div>
|
||||
<div class="result_box">
|
||||
<p>Экономия по налогу на прибыль (до)</p>
|
||||
<p><span id="calculator_tax_savings_value"><?= number_format($arResult['CALCULATION']['tax_savings'], 0, '.', ' '); ?></span> ₽</p>
|
||||
</div>
|
||||
<div class="result_box">
|
||||
<p>НДС к возмещению из бюджета (до)</p>
|
||||
<p><span id="calculator_vat_reimbursement_value"><?= number_format($arResult['CALCULATION']['vat_reimbursement'], 0, '.', ' '); ?></span> ₽</p>
|
||||
</div>
|
||||
<div class="calc_footer">
|
||||
<a href="#order" class="button button-blue">Отправить заявку</a>
|
||||
<button class="button button-blue" id="calculation_reset">Сбросить к базовым значениям</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.other.positions",
|
||||
"",
|
||||
Array(
|
||||
"EXCEPT" => $arResult['ID'],
|
||||
"BRAND_ID" => $arResult['PROPERTIES']['BRAND']['RELATED']['ID'],
|
||||
"BRAND_CODE" => $arResult['PROPERTIES']['BRAND']['RELATED']['CODE'],
|
||||
"BRAND_NAME" => $arResult['PROPERTIES']['BRAND']['RELATED']['NAME'],
|
||||
"MODEL_ID" => $arResult['PROPERTIES']['MODEL']['RELATED']['ID'],
|
||||
"MODEL_CODE" => $arResult['PROPERTIES']['MODEL']['RELATED']['CODE'],
|
||||
"MODEL_NAME" => $arResult['PROPERTIES']['MODEL']['RELATED']['NAME'],
|
||||
)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fullscreen">
|
||||
<div id="overlay"></div>
|
||||
<img id="overlay_image"/>
|
||||
<div id="overlay_left">
|
||||
<div id="overlay_left_icon"></div>
|
||||
</div>
|
||||
<div id="overlay_right">
|
||||
<div id="overlay_right_icon"></div>
|
||||
</div>
|
||||
<div id="overlay_close">
|
||||
<div id="overlay_close_icon"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
8
local/components/evolution/used.catalog/.description.php
Normal file
8
local/components/evolution/used.catalog/.description.php
Normal file
@ -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/used.catalog/.parameters.php
Normal file
14
local/components/evolution/used.catalog/.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',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
576
local/components/evolution/used.catalog/component.php
Normal file
576
local/components/evolution/used.catalog/component.php
Normal file
@ -0,0 +1,576 @@
|
||||
<?
|
||||
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" => "DESC", "ID" => "DESC");
|
||||
if(isset($arParams['SORT']))
|
||||
{
|
||||
if($arParams['SORT'] === "name")
|
||||
{
|
||||
$sort = Array("SORT" => "DESC", "NAME" => "ASC");
|
||||
$arResult['SCROLL'] = true;
|
||||
}
|
||||
if($arParams['SORT'] === "date")
|
||||
{
|
||||
$sort = Array("SORT" => "DESC", "ID" => "DESC");
|
||||
$arResult['SCROLL'] = true;
|
||||
}
|
||||
if($arParams['SORT'] === "low")
|
||||
{
|
||||
$sort = Array("SORT" => "DESC", "PROPERTY_PRICE" => "ASC");
|
||||
$query_arr['SORT'] = $arParams['SORT'];
|
||||
$arResult['SCROLL'] = true;
|
||||
}
|
||||
if($arParams['SORT'] === "high")
|
||||
{
|
||||
$sort = Array("SORT" => "DESC", "PROPERTY_PRICE" => "DESC");
|
||||
$query_arr['SORT'] = $arParams['SORT'];
|
||||
$arResult['SCROLL'] = true;
|
||||
}
|
||||
|
||||
$arResult['SELECTED']['SORT'] = $arParams['SORT'];
|
||||
}
|
||||
$filter = Array("IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_USED);
|
||||
$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'] = 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"], ["IBLOCK_ID" => IBLOCK_ID_BRANDS_USED, "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_USED, "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');
|
||||
}
|
||||
}
|
||||
|
||||
//$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/catalog/'.$ar_res['PROPERTIES']['BRAND']['RELATED']['CODE'].'/'.$ar_res['PROPERTIES']['MODEL']['RELATED']['CODE'].'/"/>');
|
||||
|
||||
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['YEAR_FROM']) || !empty($arParams['YEAR_TO']))
|
||||
{
|
||||
$parameters_filter_count++;
|
||||
|
||||
$arResult['EXTENDED'] = true;
|
||||
$arResult['BY_OPTIONS'] = true;
|
||||
$arResult['SCROLL'] = true;
|
||||
|
||||
$filter['><PROPERTY_YEAR'] = [ !empty($arParams['YEAR_FROM']) ? $arParams['YEAR_FROM'] : 0, !empty($arParams['YEAR_TO']) ? $arParams['YEAR_TO'] : 10000 ];
|
||||
|
||||
if(!empty($arParams['YEAR_FROM']))
|
||||
{
|
||||
$arResult['SELECTED']['YEAR_FROM'] = $arParams['YEAR_FROM'];
|
||||
$query_arr['YEAR_FROM'] = $arParams['YEAR_FROM'];
|
||||
}
|
||||
if(!empty($arParams['YEAR_TO']))
|
||||
{
|
||||
$arResult['SELECTED']['YEAR_TO'] = $arParams['YEAR_TO'];
|
||||
$query_arr['YEAR_TO'] = $arParams['YEAR_TO'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arParams['MILEAGE_FROM']) || !empty($arParams['MILEAGE_TO']))
|
||||
{
|
||||
$parameters_filter_count++;
|
||||
|
||||
$arResult['EXTENDED'] = true;
|
||||
$arResult['BY_OPTIONS'] = true;
|
||||
$arResult['SCROLL'] = true;
|
||||
|
||||
$filter['><PROPERTY_MILEAGE'] = [ !empty($arParams['MILEAGE_FROM']) ? $arParams['MILEAGE_FROM'] : 0, !empty($arParams['MILEAGE_TO']) ? $arParams['MILEAGE_TO'] : 10000000 ];
|
||||
|
||||
if(!empty($arParams['MILEAGE_FROM']))
|
||||
{
|
||||
$arResult['SELECTED']['MILEAGE_FROM'] = $arParams['MILEAGE_FROM'];
|
||||
$query_arr['MILEAGE_FROM'] = $arParams['MILEAGE_FROM'];
|
||||
}
|
||||
if(!empty($arParams['MILEAGE_TO']))
|
||||
{
|
||||
$arResult['SELECTED']['MILEAGE_TO'] = $arParams['MILEAGE_TO'];
|
||||
$query_arr['MILEAGE_TO'] = $arParams['MILEAGE_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(!empty($arParams['VEHICLE_TYPE']))
|
||||
{
|
||||
$arResult['EXTENDED'] = true;
|
||||
$arResult['BY_OPTIONS'] = true;
|
||||
$arResult['SCROLL'] = true;
|
||||
|
||||
$arResult['SELECTED']['VEHICLE_TYPE'] = $arParams['VEHICLE_TYPE'];
|
||||
$filter['=PROPERTY_VEHICLE_TYPE'] = $arParams['VEHICLE_TYPE'];
|
||||
|
||||
$query_arr['VEHICLE_TYPE'] = $arParams['VEHICLE_TYPE'];
|
||||
}
|
||||
|
||||
if(!empty($arParams['VEHICLE_SUBTYPE']))
|
||||
{
|
||||
$arResult['EXTENDED'] = true;
|
||||
$arResult['BY_OPTIONS'] = true;
|
||||
$arResult['SCROLL'] = true;
|
||||
|
||||
$arResult['SELECTED']['VEHICLE_SUBTYPE'] = $arParams['VEHICLE_SUBTYPE'];
|
||||
$filter['=PROPERTY_VEHICLE_SUBTYPE'] = $arParams['VEHICLE_SUBTYPE'];
|
||||
|
||||
$query_arr['VEHICLE_SUBTYPE'] = $arParams['VEHICLE_SUBTYPE'];
|
||||
}
|
||||
|
||||
if(!empty($arParams['PARKING_CITY']))
|
||||
{
|
||||
$arResult['EXTENDED'] = true;
|
||||
$arResult['BY_OPTIONS'] = true;
|
||||
$arResult['SCROLL'] = true;
|
||||
|
||||
$arResult['SELECTED']['PARKING_CITY'] = $arParams['PARKING_CITY'];
|
||||
$filter['=PROPERTY_PARKING_CITY'] = $arParams['PARKING_CITY'];
|
||||
|
||||
$query_arr['PARKING_CITY'] = $arParams['PARKING_CITY'];
|
||||
}
|
||||
|
||||
//$pages_url = $pages_url."/";
|
||||
|
||||
if(count($query_arr) > 0)
|
||||
{
|
||||
$query = http_build_query($query_arr);
|
||||
}
|
||||
//if(!empty($_SERVER['REDIRECT_QUERY_STRING']))
|
||||
//{
|
||||
// $query = $_SERVER['REDIRECT_QUERY_STRING'];
|
||||
//}
|
||||
|
||||
/*
|
||||
if(isset($arParams["sort"]))
|
||||
{
|
||||
$sort = $arParams["sort"];
|
||||
}
|
||||
|
||||
if(isset($arParams["options"]))
|
||||
{
|
||||
$options = $arParams["options"];
|
||||
}
|
||||
else
|
||||
{
|
||||
//$options = false;
|
||||
}
|
||||
|
||||
if(isset($arParams["filter"]))
|
||||
{
|
||||
$filter = array_merge($filter, $arParams["filter"]);
|
||||
}
|
||||
|
||||
if(!empty($_REQUEST['filter']['city_id']))
|
||||
{
|
||||
$filter['PROPERTY_CITY'] = $_REQUEST['filter']['city_id'];
|
||||
}
|
||||
|
||||
//if(!empty($_REQUEST['filter']['subway_id']))
|
||||
//{
|
||||
//$filter['PROPERTY_SUBWAY'] = $_REQUEST['filter']['subway_id'];
|
||||
//}
|
||||
|
||||
if(is_array($_REQUEST['subways']))
|
||||
{
|
||||
$subs = Array(); foreach($_REQUEST['subways'] AS $s) { array_push($subs, $s); }
|
||||
$filter['PROPERTY_SUBWAY'] = $subs;
|
||||
}
|
||||
*/
|
||||
|
||||
$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())
|
||||
{
|
||||
print "<!-- MODEL RELATED";
|
||||
print_r($ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
print "-->";
|
||||
$ar_res = $obElement->GetFields();
|
||||
$ar_res['PROPERTIES'] = $obElement->GetProperties();
|
||||
if(!empty($ar_res['PROPERTIES']['BRAND']['VALUE']))
|
||||
{
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS_USED, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
}
|
||||
if(!empty($ar_res['PROPERTIES']['MODEL']['VALUE']))
|
||||
{
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS_USED, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
}
|
||||
if(!empty($ar_res['PROPERTIES']['MODIFICATION']['VALUE']))
|
||||
{
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(10, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
}
|
||||
|
||||
$price = $ar_res['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? $ar_res['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] : $ar_res['PROPERTIES']['PRICE']['VALUE'];
|
||||
|
||||
$ar_res['CALCULATION'] = [];
|
||||
$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['PREVIEW_PICTURE'] = CFile::GetPath($ar_res['PROPERTIES']['PHOTO']['VALUE']);
|
||||
|
||||
$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($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();
|
||||
/*header('Content-Type: application/json; charset=utf-8');
|
||||
$response = [
|
||||
'PAGE_CURRENT' => $arResult['PAGE_CURRENT'],
|
||||
'PAGE_COUNT' => $arResult['PAGE_COUNT'],
|
||||
'PAGINATION' => $arResult['NAV_STRING'],
|
||||
'ITEMS' => [],
|
||||
];
|
||||
|
||||
foreach($arResult['ITEMS'] AS $item)
|
||||
{
|
||||
$position = [
|
||||
$item
|
||||
];
|
||||
|
||||
array_push($response['ITEMS'], $position);
|
||||
}
|
||||
print json_encode($arResult);
|
||||
*/
|
||||
|
||||
$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,200 @@
|
||||
<?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_used">
|
||||
<option disabled selected value="">Марка</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select name="model" id="small_filter_models_used">
|
||||
<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'],
|
||||
"USED" => true,
|
||||
)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
<? if(count($arResult['ITEMS']) > 0): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.sort",
|
||||
"",
|
||||
Array(
|
||||
"SORT" => $arParams['SORT'],
|
||||
"FILTER" => $arResult['FILTER_SMALL'],
|
||||
"USED" => true,
|
||||
)
|
||||
); ?>
|
||||
<? else: ?>
|
||||
<div class="catalog_sort">
|
||||
<div class="sort_container sort_selector">
|
||||
</div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<? if(count($arResult['ITEMS']) > 0): ?>
|
||||
<div class="catalog_list" id="catalog_positions_list">
|
||||
<? foreach($arResult['ITEMS'] AS $arItem): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:used.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(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:used.catalog.list.item",
|
||||
"",
|
||||
$arItem
|
||||
); ?>
|
||||
<? endforeach; ?>
|
||||
@ -74,15 +74,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<div id="cookie">
|
||||
<button class="close" area-label="Закрыть"></button>
|
||||
<p>Мы <a href="/cookies/">используем cookies</a> для улучшения использования сайта.</p>
|
||||
</div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://www.google.com/recaptcha/api.js?render=<?= RECAPTCHA_SITE_KEY; ?>"></script>
|
||||
<script src="/local/templates/evolution/js/embla-carousel.umd.min.js"></script>
|
||||
<script src="/local/templates/evolution/js/rangeslider.min.js"></script>
|
||||
<script src="/local/templates/evolution/js/main.js"></script>
|
||||
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:mainoffice.markup",
|
||||
@ -90,3 +93,107 @@
|
||||
Array()
|
||||
);
|
||||
?>
|
||||
|
||||
<?/*
|
||||
<!-- Предварительное одобрение --->
|
||||
<div id="preaprove_block">
|
||||
<button class="block_open block_toggle">
|
||||
<i>
|
||||
<img src="/images/icons/approve_icon.svg" loading="lazy" alt="Одобрение" width="34" height="40" />
|
||||
</i>
|
||||
<span>Предварительное одобрение за 1 минуту</span>
|
||||
</button>
|
||||
|
||||
<div class="block_form">
|
||||
<div class="block_header">
|
||||
<button class="block_close block_toggle" title="Свернуть"></button>
|
||||
<p class="block_title"></p>
|
||||
</div>
|
||||
|
||||
<form>
|
||||
<div class="step">
|
||||
<div class="form_field">
|
||||
<input type="text" placeholder="ИНН" />
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select>
|
||||
<option selected disabled value="">Тип программы лизинга</option>
|
||||
<option value="1">2</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select>
|
||||
<option selected disabled value="">Марка</option>
|
||||
<option value="BMW">BMW</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select>
|
||||
<option selected disabled value="">Модель</option>
|
||||
<option value="X6">X6</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<input type="text" placeholder="Стоимость" />
|
||||
</div>
|
||||
<button class="button button-blue next">Отправить на одобрение</button>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="form_field">
|
||||
<input type="text" placeholder="Ваше имя" />
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<input type="phone" placeholder="Номер телефона" />
|
||||
</div>
|
||||
<button class="button button-blue" type="submit">Отправить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function InitAprrove() {
|
||||
const wrap = $("#preaprove_block");
|
||||
const form = $(wrap).find("form");
|
||||
|
||||
const checkFields = () => {
|
||||
var currentStep = $(".step.active");
|
||||
var inputsFilled = currentStep.find("input,select").filter(function() {
|
||||
return $(this).val() === ""|| $(this).val() === null;
|
||||
}).length === 0;
|
||||
|
||||
if(!inputsFilled) {
|
||||
alert("Пожалуйста, заполните все поля.");
|
||||
}
|
||||
return inputsFilled;
|
||||
}
|
||||
|
||||
$(wrap).on("click", ".block_toggle", function(e) {
|
||||
e.preventDefault();
|
||||
$(wrap).toggleClass("active");
|
||||
$(wrap).find(".block_title").text("Получите предварительное одобрение за 1 минуту");
|
||||
$(wrap).find(".step").eq(0).addClass("active").siblings().removeClass("active");
|
||||
});
|
||||
|
||||
$(wrap).on("click", ".next", function(e) {
|
||||
e.preventDefault();
|
||||
var currentStep = $(".step.active");
|
||||
|
||||
if (checkFields()) {
|
||||
currentStep.removeClass("active");
|
||||
$(wrap).find(".block_title").text("Вам предварительно одобрено всё");
|
||||
currentStep.next(".step").addClass("active");
|
||||
}
|
||||
});
|
||||
|
||||
$(form).on("submit", function(e) {
|
||||
e.preventDefault();
|
||||
if(checkFields()) {
|
||||
console.log("send");
|
||||
$(form).reset();
|
||||
$(wrap).find(".block_close").click();
|
||||
}
|
||||
})
|
||||
}());
|
||||
</script>
|
||||
*/?>
|
||||
989
local/sitemap.php
Normal file
989
local/sitemap.php
Normal file
@ -0,0 +1,989 @@
|
||||
<?
|
||||
define('STOP_STATISTICS', true);
|
||||
define('NO_KEEP_STATISTIC', 'Y');
|
||||
define('NO_AGENT_STATISTIC', 'Y');
|
||||
define('DisableEventsCheck', true);
|
||||
define('BX_SECURITY_SHOW_MESSAGE', true);
|
||||
define('NOT_CHECK_PERMISSIONS', true);
|
||||
|
||||
$_SERVER['DOCUMENT_ROOT'] = dirname(__DIR__, 1);
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php');
|
||||
|
||||
use Bitrix\Main;
|
||||
use Bitrix\Main\IO;
|
||||
use Bitrix\Main\SiteTable;
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
use Bitrix\Seo\RobotsFile;
|
||||
use Bitrix\Seo\SitemapIblock;
|
||||
use Bitrix\Seo\SitemapTable;
|
||||
use Bitrix\Seo\SitemapIndex;
|
||||
use Bitrix\Seo\SitemapRuntime;
|
||||
use Bitrix\Seo\SitemapRuntimeTable;
|
||||
|
||||
Main\Loader::includeModule('seo');
|
||||
Main\Loader::includeModule('iblock');
|
||||
|
||||
$ID = 1;
|
||||
$NS = [];
|
||||
$SESSION = [];
|
||||
$arSitemap = null;
|
||||
|
||||
if($ID > 0)
|
||||
{
|
||||
$dbSitemap = SitemapTable::getById($ID);
|
||||
$arSitemap = $dbSitemap->fetch();
|
||||
|
||||
$dbSite = SiteTable::getByPrimary($arSitemap['SITE_ID']);
|
||||
$arSitemap['SITE'] = $dbSite->fetch();
|
||||
}
|
||||
|
||||
$arSitemap['SETTINGS'] = unserialize($arSitemap['SETTINGS'], ['allowed_classes' => false]);
|
||||
|
||||
$arSitemapSettings = array(
|
||||
'SITE_ID' => $arSitemap['SITE_ID'],
|
||||
'PROTOCOL' => $arSitemap['SETTINGS']['PROTO'] == 1 ? 'https' : 'http',
|
||||
'DOMAIN' => $arSitemap['SETTINGS']['DOMAIN'],
|
||||
);
|
||||
|
||||
function seoSitemapGetFilesData($PID, $arSitemap, $arCurrentDir, $sitemapFile)
|
||||
{
|
||||
global $ID;
|
||||
global $NS;
|
||||
global $SESSION;
|
||||
global $arSitemap;
|
||||
global $arSitemapSettings;
|
||||
|
||||
//global $NS;
|
||||
|
||||
$arDirList = array();
|
||||
|
||||
if($arCurrentDir['ACTIVE'] == SitemapRuntimeTable::ACTIVE)
|
||||
{
|
||||
$list = \CSeoUtils::getDirStructure(
|
||||
$arSitemap['SETTINGS']['logical'] == 'Y',
|
||||
$arSitemap['SITE_ID'],
|
||||
$arCurrentDir['ITEM_PATH']
|
||||
);
|
||||
|
||||
foreach($list as $dir)
|
||||
{
|
||||
$dirKey = "/".ltrim($dir['DATA']['ABS_PATH'], "/");
|
||||
|
||||
if($dir['TYPE'] == 'F')
|
||||
{
|
||||
if(!isset($arSitemap['SETTINGS']['FILE'][$dirKey])
|
||||
|| $arSitemap['SETTINGS']['FILE'][$dirKey] == 'Y')
|
||||
{
|
||||
if(preg_match($arSitemap['SETTINGS']['FILE_MASK_REGEXP'], $dir['FILE']))
|
||||
{
|
||||
$f = new IO\File($dir['DATA']['PATH'], $arSitemap['SITE_ID']);
|
||||
$sitemapFile->addFileEntry($f);
|
||||
$NS['files_count']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!isset($arSitemap['SETTINGS']['DIR'][$dirKey])
|
||||
|| $arSitemap['SETTINGS']['DIR'][$dirKey] == 'Y')
|
||||
{
|
||||
$arDirList[] = $dirKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$len = mb_strlen($arCurrentDir['ITEM_PATH']);
|
||||
if(!empty($arSitemap['SETTINGS']['DIR']))
|
||||
{
|
||||
foreach($arSitemap['SETTINGS']['DIR'] as $dirKey => $checked)
|
||||
{
|
||||
if($checked == 'Y')
|
||||
{
|
||||
if(strncmp($arCurrentDir['ITEM_PATH'], $dirKey, $len) === 0)
|
||||
{
|
||||
$arDirList[] = $dirKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arSitemap['SETTINGS']['FILE']))
|
||||
{
|
||||
foreach($arSitemap['SETTINGS']['FILE'] as $dirKey => $checked)
|
||||
{
|
||||
if($checked == 'Y')
|
||||
{
|
||||
if(strncmp($arCurrentDir['ITEM_PATH'], $dirKey, $len) === 0)
|
||||
{
|
||||
$fileName = IO\Path::combine(
|
||||
SiteTable::getDocumentRoot($arSitemap['SITE_ID']),
|
||||
$dirKey
|
||||
);
|
||||
|
||||
if(!is_dir($fileName))
|
||||
{
|
||||
$f = new IO\File($fileName, $arSitemap['SITE_ID']);
|
||||
if($f->isExists()
|
||||
&& !$f->isSystem()
|
||||
&& preg_match($arSitemap['SETTINGS']['FILE_MASK_REGEXP'], $f->getName())
|
||||
)
|
||||
{
|
||||
$sitemapFile->addFileEntry($f);
|
||||
$NS['files_count']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count($arDirList) > 0)
|
||||
{
|
||||
foreach($arDirList as $dirKey)
|
||||
{
|
||||
$arRuntimeData = array(
|
||||
'PID' => $PID,
|
||||
'ITEM_PATH' => $dirKey,
|
||||
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED,
|
||||
'ACTIVE' => SitemapRuntimeTable::ACTIVE,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_DIR,
|
||||
);
|
||||
SitemapRuntimeTable::add($arRuntimeData);
|
||||
}
|
||||
}
|
||||
|
||||
SitemapRuntimeTable::update($arCurrentDir['ID'], array(
|
||||
'PROCESSED' => SitemapRuntimeTable::PROCESSED
|
||||
));
|
||||
}
|
||||
|
||||
function generate($v)
|
||||
{
|
||||
global $ID;
|
||||
global $NS;
|
||||
global $SESSION;
|
||||
global $arSitemap;
|
||||
global $arSitemapSettings;
|
||||
|
||||
$arValueSteps = array(
|
||||
'init' => 0,
|
||||
'files' => 40,
|
||||
'iblock_index' => 50,
|
||||
'iblock' => 60,
|
||||
'forum_index' => 70,
|
||||
'forum' => 80,
|
||||
'index' => 100,
|
||||
);
|
||||
|
||||
$PID = $ID;
|
||||
|
||||
if($v == $arValueSteps['init'])
|
||||
{
|
||||
SitemapRuntimeTable::clearByPid($PID);
|
||||
|
||||
$NS['time_start'] = microtime(true);
|
||||
$NS['files_count'] = 0;
|
||||
$NS['steps_count'] = 0;
|
||||
|
||||
$bRootChecked = isset($arSitemap['SETTINGS']['DIR']['/'])
|
||||
&& $arSitemap['SETTINGS']['DIR']['/'] == 'Y';
|
||||
|
||||
$arRuntimeData = array(
|
||||
'PID' => $PID,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_DIR,
|
||||
'ITEM_PATH' => '/',
|
||||
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED,
|
||||
'ACTIVE' => $bRootChecked ? SitemapRuntimeTable::ACTIVE : SitemapRuntimeTable::INACTIVE,
|
||||
);
|
||||
|
||||
SitemapRuntimeTable::add($arRuntimeData);
|
||||
|
||||
$msg = 'SITEMAP_RUN_FILES' . ' ' . '/'."\n";
|
||||
|
||||
$sitemapFile = new SitemapRuntime($PID, $arSitemap['SETTINGS']['FILENAME_FILES'], $arSitemapSettings);
|
||||
|
||||
$v++;
|
||||
}
|
||||
elseif($v < $arValueSteps['files'])
|
||||
{
|
||||
$NS['steps_count']++;
|
||||
|
||||
$sitemapFile = new SitemapRuntime($PID, $arSitemap['SETTINGS']['FILENAME_FILES'], $arSitemapSettings);
|
||||
|
||||
$stepDuration = 15;
|
||||
$ts_finish = microtime(true) + $stepDuration * 0.95;
|
||||
|
||||
$bFinished = false;
|
||||
$bCheckFinished = false;
|
||||
|
||||
$dbRes = null;
|
||||
|
||||
while(!$bFinished && microtime(true) <= $ts_finish)
|
||||
{
|
||||
if(!$dbRes)
|
||||
{
|
||||
$dbRes = SitemapRuntimeTable::getList(array(
|
||||
'order' => array('ITEM_PATH' => 'ASC'),
|
||||
'filter' => array(
|
||||
'PID' => $PID,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_DIR,
|
||||
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED,
|
||||
),
|
||||
'limit' => 1000
|
||||
));
|
||||
}
|
||||
|
||||
if($arRes = $dbRes->Fetch())
|
||||
{
|
||||
seoSitemapGetFilesData($PID, $arSitemap, $arRes, $sitemapFile);
|
||||
$bCheckFinished = false;
|
||||
}
|
||||
elseif(!$bCheckFinished)
|
||||
{
|
||||
$dbRes = null;
|
||||
$bCheckFinished = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bFinished = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$bFinished)
|
||||
{
|
||||
if($v < $arValueSteps['files']-1)
|
||||
$v++;
|
||||
|
||||
$msg = 'SITEMAP_RUN_FILES'.' '.'ITEM_PATH'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!is_array($NS['XML_FILES']))
|
||||
$NS['XML_FILES'] = array();
|
||||
|
||||
if($sitemapFile->isNotEmpty())
|
||||
{
|
||||
if($sitemapFile->isCurrentPartNotEmpty())
|
||||
{
|
||||
$sitemapFile->finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
$sitemapFile->delete();
|
||||
}
|
||||
|
||||
$xmlFiles = $sitemapFile->getNameList();
|
||||
$directory = $sitemapFile->getPathDirectory();
|
||||
foreach($xmlFiles as &$xmlFile)
|
||||
$xmlFile = $directory.$xmlFile;
|
||||
$NS['XML_FILES'] = array_unique(array_merge($NS['XML_FILES'], $xmlFiles));
|
||||
}
|
||||
else
|
||||
{
|
||||
$sitemapFile->delete();
|
||||
}
|
||||
|
||||
$v = $arValueSteps['files'];
|
||||
$msg = 'SITEMAP_RUN_FILE_COMPLETE'.' '.$arSitemap['SETTINGS']['FILENAME_FILES']."\n";
|
||||
}
|
||||
|
||||
}
|
||||
elseif($v < $arValueSteps['iblock_index'])
|
||||
{
|
||||
$NS['time_start'] = microtime(true);
|
||||
|
||||
$arIBlockList = array();
|
||||
if(Main\Loader::includeModule('iblock'))
|
||||
{
|
||||
$arIBlockList = $arSitemap['SETTINGS']['IBLOCK_ACTIVE'];
|
||||
if(count($arIBlockList) > 0)
|
||||
{
|
||||
$arIBlocks = array();
|
||||
$dbIBlock = CIBlock::GetList(array(), array('ID' => array_keys($arIBlockList)));
|
||||
while ($arIBlock = $dbIBlock->Fetch())
|
||||
{
|
||||
$arIBlocks[$arIBlock['ID']] = $arIBlock;
|
||||
}
|
||||
|
||||
foreach($arIBlockList as $iblockId => $iblockActive)
|
||||
{
|
||||
if($iblockActive !== 'Y' || !array_key_exists($iblockId, $arIBlocks))
|
||||
{
|
||||
unset($arIBlockList[$iblockId]);
|
||||
}
|
||||
else
|
||||
{
|
||||
SitemapRuntimeTable::add(array(
|
||||
'PID' => $PID,
|
||||
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED,
|
||||
'ITEM_ID' => $iblockId,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_IBLOCK,
|
||||
));
|
||||
|
||||
$fileName = str_replace(
|
||||
array('#IBLOCK_ID#', '#IBLOCK_CODE#', '#IBLOCK_XML_ID#'),
|
||||
array($iblockId, $arIBlocks[$iblockId]['CODE'], $arIBlocks[$iblockId]['XML_ID']),
|
||||
$arSitemap['SETTINGS']['FILENAME_IBLOCK']
|
||||
);
|
||||
|
||||
$sitemapFile = new SitemapRuntime($PID, $fileName, $arSitemapSettings);
|
||||
if($sitemapFile->isExists())
|
||||
{
|
||||
//$sitemapFile->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$NS['LEFT_MARGIN'] = 0;
|
||||
$NS['IBLOCK_LASTMOD'] = 0;
|
||||
|
||||
$NS['IBLOCK'] = array();
|
||||
$NS['IBLOCK_MAP'] = array();
|
||||
|
||||
if(count($arIBlockList) <= 0)
|
||||
{
|
||||
$v = $arValueSteps['iblock'];
|
||||
$msg = 'SITEMAP_RUN_IBLOCK_EMPTY'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$v = $arValueSteps['iblock_index'];
|
||||
$msg = 'SITEMAP_RUN_IBLOCK'."\n";
|
||||
}
|
||||
}
|
||||
else if($v < $arValueSteps['iblock'])
|
||||
{
|
||||
$stepDuration = 10;
|
||||
$ts_finish = microtime(true) + $stepDuration * 0.95;
|
||||
|
||||
$bFinished = false;
|
||||
$bCheckFinished = false;
|
||||
|
||||
$currentIblock = false;
|
||||
$iblockId = 0;
|
||||
|
||||
$dbOldIblockResult = null;
|
||||
$dbIblockResult = null;
|
||||
|
||||
if(isset($SESSION["SEO_SITEMAP_".$PID]))
|
||||
{
|
||||
$NS['IBLOCK_MAP'] = $SESSION["SEO_SITEMAP_".$PID];
|
||||
unset($SESSION["SEO_SITEMAP_".$PID]);
|
||||
}
|
||||
|
||||
while(!$bFinished && microtime(true) <= $ts_finish)
|
||||
{
|
||||
if(!$currentIblock)
|
||||
{
|
||||
$arCurrentIBlock = false;
|
||||
$dbRes = SitemapRuntimeTable::getList(array(
|
||||
'order' => array('ID' => 'ASC'),
|
||||
'filter' => array(
|
||||
'PID' => $PID,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_IBLOCK,
|
||||
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED,
|
||||
),
|
||||
'limit' => 1
|
||||
));
|
||||
|
||||
$currentIblock = $dbRes->fetch();
|
||||
|
||||
if($currentIblock)
|
||||
{
|
||||
$iblockId = intval($currentIblock['ITEM_ID']);
|
||||
|
||||
$dbIBlock = CIBlock::GetByID($iblockId);
|
||||
$arCurrentIBlock = $dbIBlock->Fetch();
|
||||
|
||||
if(!$arCurrentIBlock)
|
||||
{
|
||||
SitemapRuntimeTable::update($currentIblock['ID'], array(
|
||||
'PROCESSED' => SitemapRuntimeTable::PROCESSED
|
||||
));
|
||||
|
||||
$NS['LEFT_MARGIN'] = 0;
|
||||
$NS['IBLOCK_LASTMOD'] = 0;
|
||||
$NS['LAST_ELEMENT_ID'] = 0;
|
||||
unset($NS['CURRENT_SECTION']);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($arCurrentIBlock['LIST_PAGE_URL'] == '')
|
||||
$arSitemap['SETTINGS']['IBLOCK_LIST'][$iblockId] = 'N';
|
||||
if($arCurrentIBlock['SECTION_PAGE_URL'] == '')
|
||||
$arSitemap['SETTINGS']['IBLOCK_SECTION'][$iblockId] = 'N';
|
||||
if($arCurrentIBlock['DETAIL_PAGE_URL'] == '')
|
||||
$arSitemap['SETTINGS']['IBLOCK_ELEMENT'][$iblockId] = 'N';
|
||||
|
||||
$NS['IBLOCK_LASTMOD'] = max($NS['IBLOCK_LASTMOD'], MakeTimeStamp($arCurrentIBlock['TIMESTAMP_X']));
|
||||
|
||||
if($NS['LEFT_MARGIN'] <= 0 && $arSitemap['SETTINGS']['IBLOCK_ELEMENT'][$iblockId] != 'N')
|
||||
{
|
||||
$NS['CURRENT_SECTION'] = 0;
|
||||
}
|
||||
|
||||
$fileName = str_replace(
|
||||
array('#IBLOCK_ID#', '#IBLOCK_CODE#', '#IBLOCK_XML_ID#'),
|
||||
array($iblockId, $arCurrentIBlock['CODE'], $arCurrentIBlock['XML_ID']),
|
||||
$arSitemap['SETTINGS']['FILENAME_IBLOCK']
|
||||
);
|
||||
$sitemapFile = new SitemapRuntime($PID, $fileName, $arSitemapSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$currentIblock)
|
||||
{
|
||||
$bFinished = true;
|
||||
}
|
||||
elseif(is_array($arCurrentIBlock))
|
||||
{
|
||||
if($dbIblockResult == null)
|
||||
{
|
||||
if(isset($NS['CURRENT_SECTION']))
|
||||
{
|
||||
$dbIblockResult = CIBlockElement::GetList(
|
||||
array('ID' => 'ASC'),
|
||||
array(
|
||||
'IBLOCK_ID' => $iblockId,
|
||||
'ACTIVE' => 'Y',
|
||||
'SECTION_ID' => intval($NS['CURRENT_SECTION']),
|
||||
'>ID' => intval($NS['LAST_ELEMENT_ID']),
|
||||
'SITE_ID' => $arSitemap['SITE_ID'],
|
||||
"ACTIVE_DATE" => "Y"
|
||||
),
|
||||
false,
|
||||
array('nTopCount' => 1000),
|
||||
array('ID','TIMESTAMP_X','DETAIL_PAGE_URL')
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$NS['LAST_ELEMENT_ID'] = 0;
|
||||
$dbIblockResult = CIBlockSection::GetList(
|
||||
array('LEFT_MARGIN' => 'ASC'),
|
||||
array(
|
||||
'IBLOCK_ID' => $iblockId,
|
||||
'GLOBAL_ACTIVE' => 'Y',
|
||||
'>LEFT_BORDER' => intval($NS['LEFT_MARGIN']),
|
||||
),
|
||||
false,
|
||||
array(
|
||||
'ID', 'TIMESTAMP_X', 'SECTION_PAGE_URL', 'LEFT_MARGIN', 'IBLOCK_SECTION_ID'
|
||||
),
|
||||
array('nTopCount' => 100)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($NS['CURRENT_SECTION']))
|
||||
{
|
||||
$arElement = $dbIblockResult->fetch();
|
||||
|
||||
if($arElement)
|
||||
{
|
||||
if(!is_array($NS['IBLOCK_MAP'][$iblockId]))
|
||||
{
|
||||
$NS['IBLOCK_MAP'][$iblockId] = array();
|
||||
}
|
||||
|
||||
if(!array_key_exists($arElement['ID'], $NS['IBLOCK_MAP'][$iblockId]))
|
||||
{
|
||||
$arElement['LANG_DIR'] = $arSitemap['SITE']['DIR'];
|
||||
|
||||
$bCheckFinished = false;
|
||||
$elementLastmod = MakeTimeStamp($arElement['TIMESTAMP_X']);
|
||||
$NS['IBLOCK_LASTMOD'] = max($NS['IBLOCK_LASTMOD'], $elementLastmod);
|
||||
$NS['LAST_ELEMENT_ID'] = $arElement['ID'];
|
||||
|
||||
$NS['IBLOCK'][$iblockId]['E']++;
|
||||
$NS['IBLOCK_MAP'][$iblockId][$arElement["ID"]] = 1;
|
||||
|
||||
$url = SitemapIblock::prepareUrlToReplace($arElement['DETAIL_PAGE_URL'], $arSitemap['SITE_ID']);
|
||||
$url = \CIBlock::ReplaceDetailUrl($url, $arElement, false, "E");
|
||||
|
||||
$sitemapFile->addIBlockEntry($url, $elementLastmod);
|
||||
}
|
||||
}
|
||||
elseif(!$bCheckFinished)
|
||||
{
|
||||
$bCheckFinished = true;
|
||||
$dbIblockResult = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bCheckFinished = false;
|
||||
unset($NS['CURRENT_SECTION']);
|
||||
$NS['LAST_ELEMENT_ID'] = 0;
|
||||
|
||||
$dbIblockResult = null;
|
||||
if($dbOldIblockResult)
|
||||
{
|
||||
$dbIblockResult = $dbOldIblockResult;
|
||||
$dbOldIblockResult = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$arSection = $dbIblockResult->fetch();
|
||||
|
||||
if($arSection)
|
||||
{
|
||||
$bCheckFinished = false;
|
||||
$sectionLastmod = MakeTimeStamp($arSection['TIMESTAMP_X']);
|
||||
$NS['LEFT_MARGIN'] = $arSection['LEFT_MARGIN'];
|
||||
$NS['IBLOCK_LASTMOD'] = max($NS['IBLOCK_LASTMOD'], $sectionLastmod);
|
||||
|
||||
$bActive = false;
|
||||
$bActiveElement = false;
|
||||
|
||||
if(isset($arSitemap['SETTINGS']['IBLOCK_SECTION_SECTION'][$iblockId][$arSection['ID']]))
|
||||
{
|
||||
$bActive = $arSitemap['SETTINGS']['IBLOCK_SECTION_SECTION'][$iblockId][$arSection['ID']] == 'Y';
|
||||
$bActiveElement = $arSitemap['SETTINGS']['IBLOCK_SECTION_ELEMENT'][$iblockId][$arSection['ID']] == 'Y';
|
||||
}
|
||||
elseif ($arSection['IBLOCK_SECTION_ID'] > 0)
|
||||
{
|
||||
$dbRes = SitemapRuntimeTable::getList(array(
|
||||
'filter' => array(
|
||||
'PID' => $PID,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_SECTION,
|
||||
'ITEM_ID' => $arSection['IBLOCK_SECTION_ID'],
|
||||
'PROCESSED' => SitemapRuntimeTable::PROCESSED,
|
||||
),
|
||||
'select' => array('ACTIVE', 'ACTIVE_ELEMENT'),
|
||||
'limit' => 1
|
||||
));
|
||||
|
||||
$parentSection = $dbRes->fetch();
|
||||
if($parentSection)
|
||||
{
|
||||
$bActive = $parentSection['ACTIVE'] == SitemapRuntimeTable::ACTIVE;
|
||||
$bActiveElement = $parentSection['ACTIVE_ELEMENT'] == SitemapRuntimeTable::ACTIVE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$bActive = $arSitemap['SETTINGS']['IBLOCK_SECTION'][$iblockId] == 'Y';
|
||||
$bActiveElement = $arSitemap['SETTINGS']['IBLOCK_ELEMENT'][$iblockId] == 'Y';
|
||||
}
|
||||
|
||||
$arRuntimeData = array(
|
||||
'PID' => $PID,
|
||||
'ITEM_ID' => $arSection['ID'],
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_SECTION,
|
||||
'ACTIVE' => $bActive ? SitemapRuntimeTable::ACTIVE : SitemapRuntimeTable::INACTIVE,
|
||||
'ACTIVE_ELEMENT' => $bActiveElement ? SitemapRuntimeTable::ACTIVE : SitemapRuntimeTable::INACTIVE,
|
||||
'PROCESSED' => SitemapRuntimeTable::PROCESSED,
|
||||
);
|
||||
|
||||
if($bActive)
|
||||
{
|
||||
$NS['IBLOCK'][$iblockId]['S']++;
|
||||
|
||||
$arSection['LANG_DIR'] = $arSitemap['SITE']['DIR'];
|
||||
|
||||
$url = SitemapIblock::prepareUrlToReplace($arSection['SECTION_PAGE_URL'], $arSitemap['SITE_ID']);
|
||||
$url = \CIBlock::ReplaceDetailUrl($url, $arSection, false, "S");
|
||||
|
||||
$sitemapFile->addIBlockEntry($url, $sectionLastmod);
|
||||
}
|
||||
|
||||
SitemapRuntimeTable::add($arRuntimeData);
|
||||
|
||||
if($bActiveElement)
|
||||
{
|
||||
$NS['CURRENT_SECTION'] = $arSection['ID'];
|
||||
$NS['LAST_ELEMENT_ID'] = 0;
|
||||
|
||||
$dbOldIblockResult = $dbIblockResult;
|
||||
$dbIblockResult = null;
|
||||
}
|
||||
|
||||
}
|
||||
elseif(!$bCheckFinished)
|
||||
{
|
||||
unset($NS['CURRENT_SECTION']);
|
||||
$bCheckFinished = true;
|
||||
$dbIblockResult = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bCheckFinished = false;
|
||||
|
||||
SitemapRuntimeTable::update($currentIblock['ID'], array(
|
||||
'PROCESSED' => SitemapRuntimeTable::PROCESSED,
|
||||
));
|
||||
|
||||
if($arSitemap['SETTINGS']['IBLOCK_LIST'][$iblockId] == 'Y' && $arCurrentIBlock['LIST_PAGE_URL'] <> '')
|
||||
{
|
||||
$NS['IBLOCK'][$iblockId]['I']++;
|
||||
|
||||
$arCurrentIBlock['IBLOCK_ID'] = $arCurrentIBlock['ID'];
|
||||
$arCurrentIBlock['LANG_DIR'] = $arSitemap['SITE']['DIR'];
|
||||
|
||||
$url = SitemapIblock::prepareUrlToReplace($arCurrentIBlock['LIST_PAGE_URL'], $arSitemap['SITE_ID']);
|
||||
$url = \CIBlock::ReplaceDetailUrl($url, $arCurrentIBlock, false, "");
|
||||
|
||||
$sitemapFile->addIBlockEntry($url, $NS['IBLOCK_LASTMOD']);
|
||||
}
|
||||
|
||||
if($sitemapFile->isNotEmpty())
|
||||
{
|
||||
if($sitemapFile->isCurrentPartNotEmpty())
|
||||
{
|
||||
$sitemapFile->finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
$sitemapFile->delete();
|
||||
}
|
||||
|
||||
if(!is_array($NS['XML_FILES']))
|
||||
$NS['XML_FILES'] = array();
|
||||
|
||||
$xmlFiles = $sitemapFile->getNameList();
|
||||
$directory = $sitemapFile->getPathDirectory();
|
||||
foreach($xmlFiles as &$xmlFile)
|
||||
$xmlFile = $directory.$xmlFile;
|
||||
$NS['XML_FILES'] = array_unique(array_merge($NS['XML_FILES'], $xmlFiles));
|
||||
}
|
||||
else
|
||||
{
|
||||
$sitemapFile->delete();
|
||||
}
|
||||
|
||||
$currentIblock = false;
|
||||
$NS['LEFT_MARGIN'] = 0;
|
||||
$NS['IBLOCK_LASTMOD'] = 0;
|
||||
unset($NS['CURRENT_SECTION']);
|
||||
$NS['LAST_ELEMENT_ID'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($v < $arValueSteps['iblock']-1)
|
||||
{
|
||||
$msg = 'SITEMAP_RUN_IBLOCK_NAME'.' '.$arCurrentIBlock['NAME']."\n";
|
||||
$v++;
|
||||
}
|
||||
|
||||
if($bFinished)
|
||||
{
|
||||
$v = $arValueSteps['iblock'];
|
||||
$msg = 'SITEMAP_RUN_FINALIZE'."\n";
|
||||
}
|
||||
}
|
||||
elseif($v < $arValueSteps['forum_index'])
|
||||
{
|
||||
$NS['time_start'] = microtime(true);
|
||||
|
||||
$arForumList = array();
|
||||
if(!empty($arSitemap['SETTINGS']['FORUM_ACTIVE']))
|
||||
{
|
||||
foreach ($arSitemap['SETTINGS']['FORUM_ACTIVE'] as $forumId => $active)
|
||||
{
|
||||
if ($active == "Y")
|
||||
{
|
||||
$arForumList[$forumId] = "Y";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count($arForumList) > 0 && Main\Loader::includeModule('forum'))
|
||||
{
|
||||
$arForums = array();
|
||||
$db_res = CForumNew::GetListEx(
|
||||
array(),
|
||||
array(
|
||||
'@ID' => array_keys($arForumList),
|
||||
"ACTIVE" => "Y",
|
||||
"SITE_ID" => $arSitemap['SITE_ID'],
|
||||
"!TOPICS" => 0
|
||||
)
|
||||
);
|
||||
while ($res = $db_res->Fetch())
|
||||
{
|
||||
$arForums[$res['ID']] = $res;
|
||||
}
|
||||
$arForumList = array_intersect_key($arForums, $arForumList);
|
||||
|
||||
foreach($arForumList as $id => $forum)
|
||||
{
|
||||
SitemapRuntimeTable::add(array(
|
||||
'PID' => $PID,
|
||||
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED,
|
||||
'ITEM_ID' => $id,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_FORUM)
|
||||
);
|
||||
|
||||
$fileName = str_replace('#FORUM_ID#', $forumId, $arSitemap['SETTINGS']['FILENAME_FORUM']);
|
||||
$sitemapFile = new SitemapRuntime($PID, $fileName, $arSitemapSettings);
|
||||
}
|
||||
}
|
||||
|
||||
$NS['FORUM_CURRENT_TOPIC'] = 0;
|
||||
|
||||
if(count($arForumList) <= 0)
|
||||
{
|
||||
$v = $arValueSteps['forum'];
|
||||
$msg = 'SITEMAP_RUN_FORUM_EMPTY'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$v = $arValueSteps['forum_index'];
|
||||
$msg = 'SITEMAP_RUN_FORUM'."\n";
|
||||
}
|
||||
}
|
||||
else if($v < $arValueSteps['forum'])
|
||||
{
|
||||
$stepDuration = 10;
|
||||
$ts_finish = microtime(true) + $stepDuration * 0.95;
|
||||
|
||||
$bFinished = false;
|
||||
$bCheckFinished = false;
|
||||
|
||||
$currentForum = false;
|
||||
$forumId = 0;
|
||||
|
||||
$dbTopicResult = null;
|
||||
$arTopic = null;
|
||||
|
||||
while(!$bFinished && microtime(true) <= $ts_finish && CModule::IncludeModule("forum"))
|
||||
{
|
||||
if(!$currentForum)
|
||||
{
|
||||
$arCurrentForum = false;
|
||||
$dbRes = SitemapRuntimeTable::getList(array(
|
||||
'order' => array('ID' => 'ASC'),
|
||||
'filter' => array(
|
||||
'PID' => $PID,
|
||||
'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_FORUM,
|
||||
'PROCESSED' => SitemapRuntimeTable::UNPROCESSED,
|
||||
),
|
||||
'limit' => 1
|
||||
));
|
||||
|
||||
$currentForum = $dbRes->fetch();
|
||||
|
||||
if($currentForum)
|
||||
{
|
||||
$forumId = intval($currentForum['ITEM_ID']);
|
||||
|
||||
$db_res = CForumNew::GetListEx(
|
||||
array(),
|
||||
array(
|
||||
'ID' => $forumId,
|
||||
"ACTIVE" => "Y",
|
||||
"SITE_ID" => $arSitemap['SITE_ID'],
|
||||
"!TOPICS" => 0
|
||||
)
|
||||
);
|
||||
$arCurrentForum = $db_res->Fetch();
|
||||
if(!$arCurrentForum)
|
||||
{
|
||||
SitemapRuntimeTable::update($currentForum['ID'], array(
|
||||
'PROCESSED' => SitemapRuntimeTable::PROCESSED
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$fileName = str_replace('#FORUM_ID#', $forumId, $arSitemap['SETTINGS']['FILENAME_FORUM']);
|
||||
$sitemapFile = new SitemapRuntime($PID, $fileName, $arSitemapSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$currentForum)
|
||||
{
|
||||
$bFinished = true;
|
||||
}
|
||||
elseif(is_array($arCurrentForum))
|
||||
{
|
||||
$bActive = (array_key_exists($forumId, $arSitemap['SETTINGS']['FORUM_TOPIC']) && $arSitemap['SETTINGS']['FORUM_TOPIC'][$forumId] == "Y");
|
||||
if($bActive)
|
||||
{
|
||||
if($dbTopicResult == null)
|
||||
{
|
||||
$dbTopicResult = CForumTopic::GetList(
|
||||
array("LAST_POST_DATE" => "DESC"),
|
||||
array_merge(
|
||||
array(
|
||||
"FORUM_ID" => $forumId,
|
||||
"APPROVED" => "Y"),
|
||||
($NS['FORUM_CURRENT_TOPIC'] > 0 ? array(
|
||||
">ID" => $NS["FORUM_CURRENT_TOPIC"]
|
||||
) : array()
|
||||
)
|
||||
),
|
||||
false,
|
||||
0,
|
||||
array('nTopCount' => 100)
|
||||
);
|
||||
}
|
||||
if(($arTopic = $dbTopicResult->fetch()) && $arTopic)
|
||||
{
|
||||
$NS["FORUM_CURRENT_TOPIC"] = $arTopic["ID"];
|
||||
$url = CForumNew::PreparePath2Message(
|
||||
$arCurrentForum["PATH2FORUM_MESSAGE"],
|
||||
array(
|
||||
"FORUM_ID" => $arCurrentForum["ID"],
|
||||
"TOPIC_ID" => $arTopic["ID"],
|
||||
"TITLE_SEO" => $arTopic["TITLE_SEO"],
|
||||
"MESSAGE_ID" => "s",
|
||||
"SOCNET_GROUP_ID" => $arTopic["SOCNET_GROUP_ID"],
|
||||
"OWNER_ID" => $arTopic["OWNER_ID"],
|
||||
"PARAM1" => $arTopic["PARAM1"],
|
||||
"PARAM2" => $arTopic["PARAM2"]
|
||||
)
|
||||
);
|
||||
$sitemapFile->addIBlockEntry($url, MakeTimeStamp($arTopic['LAST_POST_DATE']));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = CForumNew::PreparePath2Message(
|
||||
$arCurrentForum["PATH2FORUM_MESSAGE"],
|
||||
array(
|
||||
"FORUM_ID" => $arCurrentForum["ID"],
|
||||
"TOPIC_ID" => $arCurrentForum["TID"],
|
||||
"TITLE_SEO" => $arCurrentForum["TITLE_SEO"],
|
||||
"MESSAGE_ID" => "s",
|
||||
"SOCNET_GROUP_ID" => $arCurrentForum["SOCNET_GROUP_ID"],
|
||||
"OWNER_ID" => $arCurrentForum["OWNER_ID"],
|
||||
"PARAM1" => $arCurrentForum["PARAM1"],
|
||||
"PARAM2" => $arCurrentForum["PARAM2"]
|
||||
)
|
||||
);
|
||||
$sitemapFile->addIBlockEntry($url, MakeTimeStamp($arCurrentForum['LAST_POST_DATE']));
|
||||
}
|
||||
if (empty($arTopic))
|
||||
{
|
||||
$bCheckFinished = false;
|
||||
|
||||
SitemapRuntimeTable::update($currentForum['ID'], array(
|
||||
'PROCESSED' => SitemapRuntimeTable::PROCESSED,
|
||||
));
|
||||
|
||||
if($sitemapFile->isNotEmpty())
|
||||
{
|
||||
if($sitemapFile->isCurrentPartNotEmpty())
|
||||
{
|
||||
$sitemapFile->finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
$sitemapFile->delete();
|
||||
}
|
||||
|
||||
if(!is_array($NS['XML_FILES']))
|
||||
$NS['XML_FILES'] = array();
|
||||
|
||||
$xmlFiles = $sitemapFile->getNameList();
|
||||
$directory = $sitemapFile->getPathDirectory();
|
||||
foreach($xmlFiles as &$xmlFile)
|
||||
$xmlFile = $directory.$xmlFile;
|
||||
$NS['XML_FILES'] = array_unique(array_merge($NS['XML_FILES'], $xmlFiles));
|
||||
}
|
||||
else
|
||||
{
|
||||
$sitemapFile->delete();
|
||||
}
|
||||
|
||||
$currentForum = false;
|
||||
$dbTopicResult = null;
|
||||
$NS['FORUM_CURRENT_TOPIC'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($v < $arValueSteps['forum']-1)
|
||||
{
|
||||
$msg = 'SITEMAP_RUN_FORUM_NAME'.' '.$arCurrentForum['NAME']."\n";
|
||||
$v++;
|
||||
}
|
||||
|
||||
if($bFinished)
|
||||
{
|
||||
$v = $arValueSteps['forum'];
|
||||
$msg = 'SITEMAP_RUN_FINALIZE'."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SitemapRuntimeTable::clearByPid($PID);
|
||||
|
||||
$arFiles = array();
|
||||
|
||||
$sitemapFile = new SitemapIndex($arSitemap['SETTINGS']['FILENAME_INDEX'], $arSitemapSettings);
|
||||
|
||||
if(count($NS['XML_FILES']) > 0)
|
||||
{
|
||||
foreach ($NS['XML_FILES'] as $xmlFile)
|
||||
{
|
||||
$arFiles[] = new IO\File(IO\Path::combine(
|
||||
$sitemapFile->getSiteRoot(),
|
||||
$xmlFile
|
||||
), $arSitemap['SITE_ID']);
|
||||
}
|
||||
}
|
||||
|
||||
$sitemapFile->createIndex($arFiles);
|
||||
|
||||
$arExistedSitemaps = array();
|
||||
|
||||
if($arSitemap['SETTINGS']['ROBOTS'] == 'Y')
|
||||
{
|
||||
$sitemapUrl = $sitemapFile->getUrl();
|
||||
|
||||
$robotsFile = new RobotsFile($arSitemap['SITE_ID']);
|
||||
$robotsFile->addRule(
|
||||
array(RobotsFile::SITEMAP_RULE, $sitemapUrl)
|
||||
);
|
||||
|
||||
$arSitemapLinks = $robotsFile->getRules(RobotsFile::SITEMAP_RULE);
|
||||
if(count($arSitemapLinks) > 1) // 1 - just added rule
|
||||
{
|
||||
foreach($arSitemapLinks as $rule)
|
||||
{
|
||||
if($rule[1] != $sitemapUrl)
|
||||
{
|
||||
$arExistedSitemaps[] = $rule[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$v = $arValueSteps['index'];
|
||||
}
|
||||
|
||||
if($v == $arValueSteps['index'])
|
||||
{
|
||||
SitemapTable::update($ID, array('DATE_RUN' => new Bitrix\Main\Type\DateTime()));
|
||||
}
|
||||
|
||||
print $msg.' '.'SEO_SITEMAP_RUN_TITLE'.' '.$v."\n";
|
||||
|
||||
if($v < $arValueSteps['index'])
|
||||
{
|
||||
if(isset($NS['IBLOCK_MAP']))
|
||||
{
|
||||
$SESSION["SEO_SITEMAP_".$PID] = $NS['IBLOCK_MAP'];
|
||||
unset($NS['IBLOCK_MAP']);
|
||||
}
|
||||
}
|
||||
|
||||
return $v;
|
||||
}
|
||||
|
||||
$v = 0;
|
||||
while($v < 100)
|
||||
{
|
||||
$v = generate($v);
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1 +1,191 @@
|
||||
footer{background:#EDEFF5;padding:45px 0;box-sizing:border-box}@media all and (max-width:1600px) and (min-width:1280px){footer{padding:0}}@media all and (max-width:767px){footer{margin-top:40px;pading:25px 0}}footer .tapbar{display:none}@media all and (max-width:1279px){footer .tapbar{display:block;position:fixed;z-index:99999;box-shadow:inset 0 .5px 0 rgba(0,0,0,0.2);background:#EDEFF5;padding-bottom:env(safe-area-inset-bottom);bottom:0;left:0;right:0}footer .tapbar ul{list-style:none;padding:10px 0;margin:0;display:flex;justify-content:space-between}footer .tapbar ul li{width:25%}footer .tapbar ul li a{display:block;padding:0 4px;box-sizing:border-box}footer .tapbar ul li a svg{height:24px;display:block;margin:auto}footer .tapbar ul li a svg path{stroke:#8E94A7}footer .tapbar ul li a span{display:block;font-weight:600;font-size:13px;line-height:130%;color:#8E94A7;margin-top:6px;text-align:center}footer .tapbar ul li a.active span{color:var(--blue)}footer .tapbar ul li a.active svg path{stroke:var(--blue)}}@media all and (max-width:768px){footer .tapbar ul li a span{font-size:10px;line-height:130%}}footer .container{display:flex;justify-content:space-between;align-items:flex-start;background:transparent}@media all and (max-width:1279px){footer .container{padding:0;flex-wrap:wrap;margin-bottom:50px}}footer .column{width:270px;box-sizing:border-box}@media all and (max-width:1279px){footer .column{width:33.333%}footer .column:last-child{width:100%;display:flex;flex-wrap:wrap}footer .column:last-child>div,footer .column:last-child>p{width:33.333%;margin-top:35px;padding-right:30px;box-sizing:border-box;margin-bottom:0 !important}}@media all and (max-width:767px){footer .column{width:100%;margin-bottom:16px}footer .column:last-child>div,footer .column:last-child>p{width:100%;margin-top:15px;padding-right:0}}footer .column:not(:last-child){padding-right:15px}footer .column li:not(:last-child){margin-bottom:13px}@media all and (max-width:767px){footer .column li:not(:last-child){margin-bottom:8px}}footer .column li a{color:#000}footer .column p{color:#8E94A7;line-height:32px}footer .column a[href^="tel"]{display:inline-block;font-size:16px;line-height:32px;color:#000;padding-left:40px;background:url("/images/icons/icon-phone.svg") no-repeat left center}@media all and (max-width:1600px){footer .column a[href^="tel"]{font-size:13px;background-size:24px;padding-left:37px}}footer .column a[href^="mailto"]{display:inline-block;font-size:16px;line-height:24px;color:#000;padding-left:40px;background:url("/images/icons/icon-mail.svg") no-repeat left center}@media all and (max-width:1600px){footer .column a[href^="mailto"]{font-size:13px;background-size:24px;padding-left:37px}}footer .column div:nth-child(1),footer .column div:nth-child(2),footer .column div.socials{margin-bottom:40px}@media all and (max-width:1600px) and (min-width:1280px){footer .column div:nth-child(1),footer .column div:nth-child(2),footer .column div.socials{margin-bottom:20px}}footer .column div a{line-height:32px}@media all and (max-width:1279px){footer .column div a{line-height:1.45}}/*# sourceMappingURL=./style.css.map */
|
||||
footer {
|
||||
background: #EDEFF5;
|
||||
padding: 45px 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media all and (max-width: 1600px) and (min-width: 1280px) {
|
||||
footer {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
@media all and (max-width: 767px) {
|
||||
footer {
|
||||
margin-top: 40px;
|
||||
pading: 25px 0;
|
||||
}
|
||||
}
|
||||
footer .tapbar {
|
||||
display: none;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
footer .tapbar {
|
||||
display: block;
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
box-shadow: inset 0px 0.5px 0px rgba(0, 0, 0, 0.2);
|
||||
background: #EDEFF5;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
footer .tapbar ul {
|
||||
list-style: none;
|
||||
padding: 10px 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
footer .tapbar ul li {
|
||||
width: 25%;
|
||||
}
|
||||
footer .tapbar ul li a {
|
||||
display: block;
|
||||
padding: 0 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
footer .tapbar ul li a svg {
|
||||
height: 24px;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
footer .tapbar ul li a svg path {
|
||||
stroke: #8E94A7;
|
||||
}
|
||||
footer .tapbar ul li a span {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
line-height: 130%;
|
||||
color: #8E94A7;
|
||||
margin-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
footer .tapbar ul li a.active span {
|
||||
color: var(--blue);
|
||||
}
|
||||
footer .tapbar ul li a.active svg path {
|
||||
stroke: var(--blue);
|
||||
}
|
||||
}
|
||||
@media all and (max-width: 768px) {
|
||||
footer .tapbar ul li a span {
|
||||
font-size: 10px;
|
||||
line-height: 130%;
|
||||
}
|
||||
}
|
||||
footer .container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
background: transparent;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
footer .container {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
}
|
||||
footer .column {
|
||||
width: 270px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
footer .column {
|
||||
width: 33.333%;
|
||||
}
|
||||
footer .column:last-child {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
footer .column:last-child > div,
|
||||
footer .column:last-child > p {
|
||||
width: 33.333%;
|
||||
margin-top: 35px;
|
||||
padding-right: 30px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
@media all and (max-width: 767px) {
|
||||
footer .column {
|
||||
width: 100%;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
footer .column:last-child > div,
|
||||
footer .column:last-child > p {
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
footer .column:not(:last-child) {
|
||||
padding-right: 15px;
|
||||
}
|
||||
footer .column li:not(:last-child) {
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
@media all and (max-width: 767px) {
|
||||
footer .column li:not(:last-child) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
footer .column li a {
|
||||
color: #000;
|
||||
}
|
||||
footer .column p {
|
||||
color: #8E94A7;
|
||||
line-height: 32px;
|
||||
}
|
||||
footer .column a[href^="tel"] {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
line-height: 32px;
|
||||
color: #000;
|
||||
padding-left: 40px;
|
||||
background: url("/images/icons/icon-phone.svg") no-repeat left center;
|
||||
}
|
||||
@media all and (max-width: 1600px) {
|
||||
footer .column a[href^="tel"] {
|
||||
font-size: 13px;
|
||||
background-size: 24px;
|
||||
padding-left: 37px;
|
||||
}
|
||||
}
|
||||
footer .column a[href^="mailto"] {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
color: #000;
|
||||
padding-left: 40px;
|
||||
background: url("/images/icons/icon-mail.svg") no-repeat left center;
|
||||
}
|
||||
@media all and (max-width: 1600px) {
|
||||
footer .column a[href^="mailto"] {
|
||||
font-size: 13px;
|
||||
background-size: 24px;
|
||||
padding-left: 37px;
|
||||
}
|
||||
}
|
||||
footer .column div:nth-child(1),
|
||||
footer .column div:nth-child(2),
|
||||
footer .column div.socials {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
@media all and (max-width: 1600px) and (min-width: 1280px) {
|
||||
footer .column div:nth-child(1),
|
||||
footer .column div:nth-child(2),
|
||||
footer .column div.socials {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
footer .column div a {
|
||||
line-height: 32px;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
footer .column div a {
|
||||
line-height: 1.45;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ footer {
|
||||
@media all and (max-width: 1279px) {
|
||||
display: block;
|
||||
position: fixed;
|
||||
z-index: 99999;
|
||||
z-index: 999;
|
||||
box-shadow: inset 0px 0.5px 0px rgba(0, 0, 0, 0.2);
|
||||
background: #EDEFF5;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,7 +2,9 @@
|
||||
#filter {
|
||||
position: relative;
|
||||
|
||||
.container {position: relative;}
|
||||
.container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&.filter_in_catalog:not(.visible) {
|
||||
display: none;
|
||||
@ -122,14 +124,25 @@
|
||||
@media all and (max-width: 1279px) {
|
||||
&:last-child {
|
||||
margin-bottom: 70px;
|
||||
}
|
||||
|
||||
.fieldgroup .form_field {
|
||||
|
||||
.fieldgroup.no_space .form_field {
|
||||
width: 50%;
|
||||
|
||||
&:first-child { select {border-right: 0;}}
|
||||
&:last-child { select {border-left: 0;}}
|
||||
&:first-child {
|
||||
select {
|
||||
border-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
select {
|
||||
border-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media all and (max-width: 767px) {
|
||||
@ -137,7 +150,12 @@
|
||||
margin-bottom: 0;
|
||||
display: block;
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.static) {
|
||||
.filter_column {
|
||||
@media all and (max-width: 767px) {
|
||||
&:nth-child(1) {
|
||||
.fieldgroup {
|
||||
&:nth-child(2) {
|
||||
@ -190,6 +208,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form_field {
|
||||
width: 100%;
|
||||
@ -216,10 +235,10 @@
|
||||
}
|
||||
|
||||
.form_field {
|
||||
width: calc(50% - 20px);
|
||||
width: calc(50% - 5px);
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
width: calc(50% - 4px);
|
||||
width: calc(50% - 5px);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -239,7 +258,8 @@
|
||||
justify-content: flex-start;
|
||||
gap: 0 16px;
|
||||
|
||||
select, .form_field {
|
||||
select,
|
||||
.form_field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@ -280,7 +300,8 @@
|
||||
@media all and (max-width: 767px) {
|
||||
display: block;
|
||||
|
||||
.form_field, button {
|
||||
.form_field,
|
||||
button {
|
||||
width: 100%;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
@ -441,6 +462,7 @@
|
||||
border: 4px solid #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&:disabled+label {
|
||||
&:before {
|
||||
background: var(--gray);
|
||||
@ -602,7 +624,7 @@
|
||||
|
||||
.fade {
|
||||
position: fixed;
|
||||
z-index: 99999;
|
||||
z-index: 999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
@ -688,3 +710,126 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Предварительное одобрение
|
||||
#preaprove_block {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
left: 20px;
|
||||
bottom: 25px;
|
||||
|
||||
@media all and (max-width: 1200px) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.active {
|
||||
.block_open {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.block_form {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.block_toggle {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.block_open {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 0 13px;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
font-size: 15px;
|
||||
color: #fff;
|
||||
font-weight: 6000;
|
||||
line-height: 20px;
|
||||
padding: 11px 16px;
|
||||
border-radius: 8px;
|
||||
background: var(--blue);
|
||||
}
|
||||
|
||||
i {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 100%;
|
||||
box-shadow: 0px 4px 32px 0px rgba(0, 0, 0, 0.16);
|
||||
background: var(--blue);
|
||||
position: relative;
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background: url("/images/icons/Bell.svg") no-repeat center;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.block_form {
|
||||
display: none;
|
||||
width: 368px;
|
||||
border-radius: 15px;
|
||||
background: var(--white, #FFF);
|
||||
box-shadow: 0px 4px 32px 0px rgba(0, 0, 0, 0.16);
|
||||
overflow: hidden;
|
||||
|
||||
.block_header {
|
||||
height: 126px;
|
||||
background: var(--blue);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
padding: 24px;
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
margin: 40px 0 0 0;
|
||||
font-size: 15px;
|
||||
line-height: 23px;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
max-width: 235px;
|
||||
}
|
||||
|
||||
.block_close {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 35C28.2843 35 35 28.2843 35 20C35 11.7157 28.2843 5 20 5C11.7157 5 5 11.7157 5 20C5 28.2843 11.7157 35 20 35Z' fill='white'/%3E%3Cpath d='M25.625 18.125L20 24.375L14.375 18.125' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
|
||||
padding: 0;
|
||||
border: 0;
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
form {
|
||||
padding: 24px;
|
||||
|
||||
.form_field {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.step {
|
||||
text-align: center;
|
||||
|
||||
&:not(.active) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,6 +80,7 @@ header .header_menu nav {
|
||||
position: absolute;
|
||||
bottom: 13px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
header .header_menu nav {
|
||||
@ -91,12 +92,10 @@ header .header_menu nav .nav_toggle {
|
||||
}
|
||||
header .header_menu nav ul {
|
||||
display: flex;
|
||||
}
|
||||
header .header_menu nav ul li:not(:last-child) {
|
||||
margin-right: 95px;
|
||||
}
|
||||
header .header_menu nav ul li:last-child {
|
||||
margin-right: 63px;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
@media all and (min-width: 1280px) {
|
||||
header .header_menu nav ul li:first-child,
|
||||
@ -126,12 +125,6 @@ header .lk {
|
||||
padding: 0 16px;
|
||||
margin: 0 16px;
|
||||
}
|
||||
header .header_menu nav ul li:not(:last-child) {
|
||||
margin-right: 95px;
|
||||
}
|
||||
header .header_menu nav ul li:last-child {
|
||||
margin-right: 30px;
|
||||
}
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
header {
|
||||
@ -266,6 +259,9 @@ header .lk {
|
||||
header .header_menu nav ul li:not(:last-child) {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
header .header_menu nav form {
|
||||
margin-right: 40px;
|
||||
}
|
||||
header .header_menu a[href^="tel:"] {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
||||
@ -85,6 +85,7 @@ header {
|
||||
position: absolute;
|
||||
bottom: 13px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
bottom: 0;
|
||||
@ -96,14 +97,18 @@ header {
|
||||
|
||||
ul {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
|
||||
li {
|
||||
&:not(:last-child) {
|
||||
margin-right: 95px;
|
||||
//margin-right: 102px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-right: 63px;
|
||||
//margin-right: 63px;
|
||||
}
|
||||
|
||||
@media all and (min-width: 1280px) {
|
||||
@ -151,11 +156,11 @@ header {
|
||||
nav {
|
||||
ul li {
|
||||
&:not(:last-child) {
|
||||
margin-right: 95px;
|
||||
//margin-right: 70px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-right: 30px;
|
||||
//margin-right: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -316,6 +321,10 @@ header {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
form {
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
a[href^="tel:"] {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2231,6 +2231,7 @@ main {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-top: 60px;
|
||||
position: relative;
|
||||
|
||||
@ -5127,7 +5128,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
}
|
||||
|
||||
@media all and (max-width: 1000px) {
|
||||
left: -11px;
|
||||
left: -9px;
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
@ -5142,16 +5143,23 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
|
||||
@media all and (max-width: 1000px) {
|
||||
right: auto;
|
||||
left: -11px !important;
|
||||
left: -9px !important;
|
||||
height: 116px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 600px) {
|
||||
height: 75px;
|
||||
height: 86px;
|
||||
left: -12px !important;
|
||||
}
|
||||
|
||||
@media (max-width: 459px) and (min-width: 376px) {
|
||||
left: -9px !important;
|
||||
hegiht: 77px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 375px) {
|
||||
left: -10px !important;
|
||||
height: 60px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5614,6 +5622,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
|
||||
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
margin-bottom: 16px;
|
||||
@ -6154,8 +6163,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
font-size: 14px;
|
||||
line-height: 150%;
|
||||
|
||||
.category
|
||||
{
|
||||
.category {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
@ -6427,6 +6435,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
@media all and (max-width: 1601px) {
|
||||
padding-top: 137px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
padding-top: 125px;
|
||||
}
|
||||
@ -6438,6 +6447,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
@media all and (max-width: 1601px) {
|
||||
padding-top: 245px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
padding-top: 233px;
|
||||
}
|
||||
@ -6501,6 +6511,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
.person_name {
|
||||
font-size: 15px;
|
||||
line-height: 24px;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
font-weight: 700;
|
||||
@ -6533,6 +6544,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
margin: auto;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
display: block;
|
||||
@ -6585,11 +6597,13 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
p {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.block_title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@ -1298,3 +1298,14 @@ section[data-page][data-page="special"] + #order .container:after {
|
||||
margin-bottom: 0px !important;
|
||||
padding-bottom: 20px !important;
|
||||
}
|
||||
[data-custom-scroll]::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
}
|
||||
[data-custom-scroll]::-webkit-scrollbar-track {
|
||||
background: var(--inactive);
|
||||
}
|
||||
[data-custom-scroll]::-webkit-scrollbar-thumb {
|
||||
background: var(--blue);
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -40,38 +40,48 @@ html {
|
||||
// Zoom
|
||||
@media all and (min-width: 1280px) and (max-width: 1420px) {
|
||||
@iterations: 9;
|
||||
|
||||
.zoom-loop (@i) when (@i > 0) {
|
||||
.zoom-@{i}0 {
|
||||
zoom:~".@{i} ";
|
||||
}
|
||||
|
||||
.zoom-loop(@i - 1);
|
||||
}
|
||||
|
||||
.zoom-loop (@iterations);
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) and (max-width: 1279px) {
|
||||
@iterations: 9;
|
||||
|
||||
.zoom-loop (@i) when (@i > 0) {
|
||||
.tb-zoom-@{i}0 {
|
||||
zoom:~".@{i} ";
|
||||
}
|
||||
|
||||
.zoom-loop(@i - 1);
|
||||
}
|
||||
|
||||
.zoom-loop (@iterations);
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
@iterations: 9;
|
||||
|
||||
.zoom-loop (@i) when (@i > 0) {
|
||||
.sm-zoom-@{i}0 {
|
||||
zoom:~".@{i} ";
|
||||
}
|
||||
|
||||
.zoom-loop(@i - 1);
|
||||
}
|
||||
|
||||
.zoom-loop (@iterations);
|
||||
}
|
||||
|
||||
html,body {
|
||||
html,
|
||||
body {
|
||||
scroll-behavior: smooth;
|
||||
cursor: default;
|
||||
}
|
||||
@ -357,8 +367,7 @@ body {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@media all and (max-width: 1600px) and (min-width: 1280px) {
|
||||
}
|
||||
@media all and (max-width: 1600px) and (min-width: 1280px) {}
|
||||
|
||||
@media all and (max-width: 1279px) {
|
||||
font-size: 22px !important;
|
||||
@ -1009,7 +1018,8 @@ section[data-page] {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
&:before, &:after {
|
||||
&:before,
|
||||
&:after {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
@ -1084,3 +1094,19 @@ section[data-page] {
|
||||
margin-bottom: 0px !important;
|
||||
padding-bottom: 20px !important;
|
||||
}
|
||||
|
||||
[data-custom-scroll] {}
|
||||
|
||||
[data-custom-scroll]::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
[data-custom-scroll]::-webkit-scrollbar-track {
|
||||
background: var(--inactive);
|
||||
}
|
||||
|
||||
[data-custom-scroll]::-webkit-scrollbar-thumb {
|
||||
background: var(--blue);
|
||||
border-radius: 0px;
|
||||
}
|
||||
513
local/used.php
Normal file
513
local/used.php
Normal file
@ -0,0 +1,513 @@
|
||||
<?
|
||||
//$_SERVER["DOCUMENT_ROOT"] = __DIR__;
|
||||
define('STOP_STATISTICS', true);
|
||||
define('NO_KEEP_STATISTIC', 'Y');
|
||||
define('NO_AGENT_STATISTIC', 'Y');
|
||||
define('DisableEventsCheck', true);
|
||||
define('BX_SECURITY_SHOW_MESSAGE', true);
|
||||
define('NOT_CHECK_PERMISSIONS', true);
|
||||
|
||||
$_SERVER['DOCUMENT_ROOT'] = dirname(__DIR__, 1);
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php');
|
||||
CModule::IncludeModule('iblock');
|
||||
CModule::IncludeModule('search');
|
||||
use Bitrix\Main;
|
||||
use Bitrix\Main\IO;
|
||||
use Bitrix\Main\SiteTable;
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
use Bitrix\Seo\RobotsFile;
|
||||
use Bitrix\Seo\SitemapIblock;
|
||||
use Bitrix\Seo\SitemapTable;
|
||||
use Bitrix\Seo\SitemapIndex;
|
||||
use Bitrix\Seo\SitemapRuntime;
|
||||
use Bitrix\Seo\SitemapRuntimeTable;
|
||||
|
||||
Main\Loader::includeModule('seo');
|
||||
|
||||
$arrContextOptions = [
|
||||
"ssl" => [
|
||||
"verify_peer"=>false,
|
||||
"verify_peer_name"=>false,
|
||||
],
|
||||
];
|
||||
|
||||
$api_used_url = API_HOST."/site/GetCatalogIZT";
|
||||
$content = file_get_contents($api_used_url, false, stream_context_create($arrContextOptions));
|
||||
print $api_used_url."\n\n";
|
||||
|
||||
file_put_contents("get_catalog_izt.json", $content);
|
||||
|
||||
$json = json_decode($content, true);
|
||||
|
||||
/*
|
||||
$bitrix_brands = [];
|
||||
$bitrix_models = [];
|
||||
|
||||
$brand_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_BRANDS, ], false, false, [] );
|
||||
while($brand_search_ob = $brand_search_res->GetNextElement())
|
||||
{
|
||||
$brand_search = $brand_search_ob->GetFields();
|
||||
$brand_search['PROPERTIES'] = $brand_search_ob->GetProperties();
|
||||
|
||||
$bitrix_brands[$brand_search['PROPERTIES']['UID']['VALUE']] = $brand_search['ID'];
|
||||
}
|
||||
|
||||
$models_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODELS, ], false, false, [] );
|
||||
while($models_search_ob = $models_search_res->GetNextElement())
|
||||
{
|
||||
$model_search = $models_search_ob->GetFields();
|
||||
$model_search['PROPERTIES'] = $models_search_ob->GetProperties();
|
||||
|
||||
$bitrix_models[$model_search['PROPERTIES']['UID']['VALUE']] = $model_search['ID'];
|
||||
}
|
||||
*/
|
||||
|
||||
$flags = [];
|
||||
$flag_names = [ "SPECIAL_OFFER", "LEASING_AVAILABLE", "AFTER_ACCIDENT" ];
|
||||
|
||||
foreach($flag_names AS $f)
|
||||
{
|
||||
$properties = CIBlockPropertyEnum::GetList([ "sort" => "asc", "name" => "asc" ], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_USED, "CODE" => $f ]);
|
||||
while ($prop_fields = $properties->GetNext())
|
||||
{
|
||||
$flags[ $f ] = $prop_fields["ID"];
|
||||
|
||||
//print_r($prop_fields)."\n";
|
||||
//print $prop_fields["ID"]." - ".$prop_fields["NAME"]."\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "flags\n";
|
||||
print_r($flags);
|
||||
|
||||
print "\n\n";
|
||||
|
||||
foreach($json as $car)
|
||||
{
|
||||
print "CAR\n";
|
||||
print_r($car);
|
||||
|
||||
print "\n\n";
|
||||
}
|
||||
|
||||
$api_data = [];
|
||||
$api_data_titles = [];
|
||||
|
||||
$api_types = [];
|
||||
|
||||
$bitrix_types = [];
|
||||
$bitrix_subtypes = [];
|
||||
|
||||
$bitrix_brands = [];
|
||||
$bitrix_models = [];
|
||||
|
||||
$bitrix_cars = [];
|
||||
$api_cars = [];
|
||||
|
||||
//prepare brands list from API
|
||||
foreach($json AS $entry)
|
||||
{
|
||||
$id = strtolower($entry['brand']['id']);
|
||||
$name = $entry['brand']['name'];
|
||||
|
||||
if(!isset($api_data[ $id ]))
|
||||
{
|
||||
$api_data[ $id ] = [
|
||||
"name" => $name,
|
||||
"models" => [],
|
||||
];
|
||||
}
|
||||
|
||||
if(!isset($api_types[ $entry['vehicle_type'] ]))
|
||||
{
|
||||
$api_types[ $entry['vehicle_type'] ] = [];
|
||||
$api_types[ $entry['vehicle_type'] ][] = $entry['vehicle_subtype'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!in_array($entry['vehicle_subtype'], $api_types[ $entry['vehicle_type'] ]))
|
||||
{
|
||||
$api_types[ $entry['vehicle_type'] ][] = $entry['vehicle_subtype'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//prepare models list from API
|
||||
foreach($json AS $entry)
|
||||
{
|
||||
$brand_id = strtolower($entry['brand']['id']);
|
||||
$model_id = strtolower($entry['model']['id']);
|
||||
$brand_name = $entry['brand']['name'];
|
||||
$model_name = $entry['model']['name'];
|
||||
|
||||
if(!isset($api_data[ $brand_id ]['models'][ $model_id ]))
|
||||
{
|
||||
$api_data[ $brand_id ]['models'][ $model_id ] = [
|
||||
"name" => $model_name,
|
||||
];
|
||||
}
|
||||
|
||||
/*
|
||||
if(!isset($api_data_titles[ $brand_name ]['models'][ $model_name ]))
|
||||
{
|
||||
$api_data_titles[ $brand_name ]['models'][ $model_name ] = [
|
||||
"modifications" => []
|
||||
];
|
||||
}
|
||||
|
||||
if(!in_array($model_id, $api_models))
|
||||
{
|
||||
array_push($api_models, $model_id);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
print_r($api_data);
|
||||
|
||||
$types_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_USED_TYPES, ], false, [], [] );
|
||||
while($type_search_ob = $types_search_res->GetNextElement())
|
||||
{
|
||||
$type_existed = $type_search_ob->GetFields();
|
||||
$type_existed['PROPERTIES'] = $type_search_ob->GetProperties();
|
||||
|
||||
$subtypes = [];
|
||||
|
||||
$subtypes_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_USED_SUBTYPES, "PROPERTY_VEHICLE_TYPE" => $type_existed['ID'] ], false, [], [] );
|
||||
while($subtype_search_ob = $subtypes_search_res->GetNextElement())
|
||||
{
|
||||
$subtypes_existed = $subtype_search_ob->GetFields();
|
||||
$subtypes[] = $subtypes_existed['ID'];
|
||||
}
|
||||
|
||||
$bitrix_types[ $type_existed['NAME'] ] = [
|
||||
"ID" => $type_existed['ID'],
|
||||
"SUBTYPES" => $subtypes,
|
||||
];
|
||||
}
|
||||
|
||||
function insert_subtypes($type_id, $subtypes)
|
||||
{
|
||||
print "insert_subtypes, ".$type_id."\n";
|
||||
foreach($subtypes AS $subtype_name)
|
||||
{
|
||||
$code = CUtil::translit( $type_id."_".$subtype_name, "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] );
|
||||
|
||||
$subtype_element = new CIBlockElement;
|
||||
$subtype_payload = [ "IBLOCK_ID" => IBLOCK_ID_USED_SUBTYPES, "NAME" => $subtype_name, "CODE" => $code, "PROPERTY_VALUES" => [ "VEHICLE_TYPE" => $type_id ], "ACTIVE" => "Y", ];
|
||||
|
||||
$subtype_element->Add($subtype_payload);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($api_types AS $api_type_name => $api_subtypes)
|
||||
{
|
||||
$code = CUtil::translit( $api_type_name, "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] );
|
||||
|
||||
$type_element = new CIBlockElement;
|
||||
$type_payload = [ "IBLOCK_ID" => IBLOCK_ID_USED_TYPES, "NAME" => $api_type_name, "CODE" => $code, "ACTIVE" => "Y", ];
|
||||
|
||||
if($type_new_id = $type_element->Add($type_payload))
|
||||
{
|
||||
insert_subtypes($type_new_id, $api_subtypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
insert_subtypes($bitrix_types[ $api_type_name ]['ID'], $api_subtypes);
|
||||
}
|
||||
}
|
||||
|
||||
$cars_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_USED, ], false, [], [] );
|
||||
while($car_search_ob = $cars_search_res->GetNextElement())
|
||||
{
|
||||
$car_existed = $car_search_ob->GetFields();
|
||||
$bitrix_cars[$car_existed['CODE']] = $car_existed['ID'];
|
||||
}
|
||||
|
||||
//кешируем список имеющихся в bitrix марок
|
||||
$bitrix_existed_brands = [];
|
||||
$api_existed_brands = [];
|
||||
|
||||
$brands_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_BRANDS_USED, ], false, [], [] );
|
||||
while($brand_search_ob = $brands_search_res->GetNextElement())
|
||||
{
|
||||
$brand_existed = $brand_search_ob->GetFields();
|
||||
$brand_existed['PROPERTIES'] = $brand_search_ob->GetProperties();
|
||||
|
||||
$bitrix_brands[ $brand_existed['PROPERTIES']['UID']['VALUE'] ] = $brand_existed['ID'];
|
||||
$bitrix_existed_brands[] = $brand_existed['ID'];
|
||||
}
|
||||
|
||||
//кешируем список имеющихся в bitrix моделей
|
||||
$bitrix_existed_models = [];
|
||||
$api_existed_models = [];
|
||||
|
||||
$models_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODELS_USED, ], false, [], [] );
|
||||
while($model_search_ob = $models_search_res->GetNextElement())
|
||||
{
|
||||
$model_existed = $model_search_ob->GetFields();
|
||||
$model_existed['PROPERTIES'] = $model_search_ob->GetProperties();
|
||||
|
||||
$bitrix_models[ $model_existed['PROPERTIES']['UID']['VALUE'] ] = $model_existed['ID'];
|
||||
$bitrix_existed_models[] = $model_existed['ID'];
|
||||
}
|
||||
|
||||
//добавляем новые марки из api
|
||||
foreach($api_data AS $brand_uid => $brand)
|
||||
{
|
||||
$code = CUtil::translit( $brand['name'], "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] );
|
||||
|
||||
$brand_element = new CIBlockElement;
|
||||
$brand_payload = [ "IBLOCK_ID" => IBLOCK_ID_BRANDS_USED, "NAME" => $brand['name'], "CODE" => $code, "PROPERTY_VALUES" => [ "UID" => $brand_uid ], "ACTIVE" => "Y", ];
|
||||
|
||||
print $brand['name']." - ".$brand_uid."\n";
|
||||
if($brand_new_id = $brand_element->Add($brand_payload))
|
||||
{
|
||||
$bitrix_brands[ $brand_uid ] = $brand_new_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
//обновляем имеющуюся марку в bitrix восстанавливая из скрытого состояния
|
||||
$brands_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_BRANDS_USED, "CODE" => $code ], false, [], [] );
|
||||
while($brand_search_ob = $brands_search_res->GetNextElement())
|
||||
{
|
||||
$brand_existed = $brand_search_ob->GetFields();
|
||||
|
||||
$el = new CIBlockElement;
|
||||
$el->Update($brand_existed['ID'], ["ACTIVE" => "Y"]);
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
|
||||
//добавляем новые модели из api
|
||||
foreach($brand['models'] AS $model_uid => $model)
|
||||
{
|
||||
$code = CUtil::translit( $model['name'], "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] );
|
||||
|
||||
$model_element = new CIBlockElement;
|
||||
$model_payload = [ "IBLOCK_ID" => IBLOCK_ID_MODELS_USED, "NAME" => $model['name'], "CODE" => $code, "PROPERTY_VALUES" => [ "BRAND_UID" => $brand_uid, "UID" => $model_uid ], "ACTIVE" => "Y", ];
|
||||
|
||||
if($model_new_id = $model_element->Add($model_payload))
|
||||
{
|
||||
$bitrix_models[ $model_uid ] = $model_new_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
//обновляем имеющуюся модель в bitrix восстанавливая из скрытого состояния
|
||||
$models_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODELS_USED, "CODE" => $code ], false, [], [] );
|
||||
while($model_search_ob = $models_search_res->GetNextElement())
|
||||
{
|
||||
$model_existed = $model_search_ob->GetFields();
|
||||
|
||||
$el = new CIBlockElement;
|
||||
$el->Update($model_existed['ID'], ["ACTIVE" => "Y"]);
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
function resize_image($image, $filename, $width, $height, $quality)
|
||||
{
|
||||
$tempfile = tmpfile();
|
||||
fwrite($tempfile, $image);
|
||||
$tempfile_metadata = stream_get_meta_data($tempfile);
|
||||
$tempfile_filename = $tempfile_metadata['uri'];
|
||||
|
||||
$mime = mime_content_type($tempfile_metadata['uri']);
|
||||
$ext = get_ext_from_mime($mime);
|
||||
|
||||
//$source = imagecreatefromjpeg($file_full_path_original);
|
||||
|
||||
//$tempfile = tmpfile();
|
||||
//fwrite($tempfile, $image);
|
||||
//$tempfile_metadata = stream_get_meta_data($tempfile);
|
||||
|
||||
$resized = imagecreatetruecolor($width, $height);
|
||||
$source = imagecreatefromstring($image);
|
||||
|
||||
$original_width = imagesx($source);
|
||||
$original_height = imagesy($source);
|
||||
|
||||
$panel_width = $width;
|
||||
$panel_height = ($original_height * ($width / $original_width));
|
||||
$panel = imagecreatetruecolor($panel_width, $panel_height);
|
||||
imagecopyresampled($panel, $source, 0, 0, 0, 0, $panel_width, $panel_height, $original_width, $original_height);
|
||||
imagecopyresampled($resized, $panel, 0, 0, 0, (($panel_height - $height) / 2), $width, $height, $panel_width, $height);
|
||||
|
||||
imagejpeg($resized, $tempfile_filename, $quality);
|
||||
|
||||
//header("Content-type: image/jpeg");
|
||||
//imagejpeg($resized, null, 100);
|
||||
|
||||
imagedestroy($source);
|
||||
imagedestroy($resized);
|
||||
imagedestroy($panel);
|
||||
|
||||
$file = CFile::MakeFileArray($tempfile_filename);
|
||||
$file['name'] = $filename.".".$ext;
|
||||
$saved_file_id = CFile::SaveFile($file, "used");
|
||||
|
||||
fclose($tempfile);
|
||||
|
||||
/*
|
||||
$file_path = CFile::GetPath($saved_file_id);
|
||||
|
||||
print "file_path\n";
|
||||
print_r($file_path);
|
||||
print "\n\n";
|
||||
//die();
|
||||
|
||||
$file_full_path_original = $_SERVER["DOCUMENT_ROOT"].$file_path;
|
||||
$file_full_path_resized = $_SERVER["DOCUMENT_ROOT"].$file_path."_resized";
|
||||
|
||||
$new_main_photo_name = $main_photo_path."_resized";
|
||||
|
||||
$file['tmp_name'] = $main_photo_path_resized;
|
||||
$file['old_file'] = $saved_file_id;
|
||||
$file['del'] = true;
|
||||
$saved_file_id = CFile::SaveFile($file, "used");
|
||||
|
||||
fclose($tempfile);
|
||||
*/
|
||||
|
||||
return $saved_file_id;
|
||||
}
|
||||
|
||||
$c = 0;
|
||||
foreach($json as $car)
|
||||
{
|
||||
$brand_id = strtolower($car['brand']['id']);
|
||||
$model_id = strtolower($car['model']['id']);
|
||||
$modification_id = md5($brand_id.$model_id.$car['modification']);
|
||||
|
||||
$name = $car['brand']['name']." ".$car['model']['name']." ".$car['modification']." ".$car['year'];
|
||||
$code = $car['article'];
|
||||
|
||||
print $car['modification']." - ".$modification_id." | ".$name."\n";
|
||||
|
||||
array_push($api_existed_brands, $bitrix_brands[ $brand_id ]);
|
||||
array_push($api_existed_models, $bitrix_models[ $model_id ]);
|
||||
|
||||
$PROPERTY_VALUES = [
|
||||
"CONTRACT" => $car['article'],
|
||||
|
||||
"VEHICLE_TYPE" => $car['vehicle_type'],
|
||||
"VEHICLE_SUBTYPE" => $car['vehicle_subtype'],
|
||||
"BRAND" => $bitrix_brands[ $brand_id ],
|
||||
"MODEL" => $bitrix_models[ $model_id ],
|
||||
"MODIFICATION" => $car['modification'],
|
||||
|
||||
"VIN" => $car['vin'],
|
||||
"YEAR" => $car['year'],
|
||||
"MILEAGE" => isset($car['mileage']) && !empty($car['mileage']) ? $car['mileage'] : 0,
|
||||
"ENGINE_HOURS" => isset($car['engine_hours']) && !empty($car['engine_hours']) ? $car['engine_hours'] : 0,
|
||||
|
||||
"ENGINE_POWER" => $car['engine']['power'],
|
||||
"ENGINE_VOLUME" => $car['engine']['volume'],
|
||||
"ENGINE_FUEL" => mb_strtolower($car['engine']['fuel']),
|
||||
|
||||
"PARKING_CITY" => $car['parking_city'],
|
||||
"PARKING_REGION" => $car['parking_region'],
|
||||
|
||||
"PRICE" => isset($car['price']) && !empty($car['price']) ? $car['price'] : 0,
|
||||
"PRICE_WITH_DISCOUNT" => isset($car['price_with_discount']) && !empty($car['price_with_discount']) ? $car['price_with_discount'] : 0,
|
||||
|
||||
"RESERVE_DATE" => $car['reserve_date'],
|
||||
"SPECIAL_OFFER" => $car['special_offer'] ? $flags['SPECIAL_OFFER'] : null,
|
||||
"LEASING_AVAILABLE" => $car['leasing_available'] ? $flags['LEASING_AVAILABLE'] : null,
|
||||
"AFTER_ACCIDENT" => $car['after_accident'] ? $flags['AFTER_ACCIDENT'] : null,
|
||||
];
|
||||
|
||||
$used_car_element = new CIBlockElement;
|
||||
$used_car_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_USED, "NAME" => $name, "CODE" => $code, "DETAIL_TEXT" => $car['description'], "PROPERTY_VALUES" => $PROPERTY_VALUES, "ACTIVE" => "Y", ];
|
||||
|
||||
print $code."\n";
|
||||
$api_cars[] = $code;
|
||||
|
||||
if($new_used_car_id = $used_car_element->Add($used_car_payload))
|
||||
{
|
||||
//добавляем новое предложение в bitrix
|
||||
$images = zerof_get_images($code);
|
||||
|
||||
if(count($images) > 0)
|
||||
{
|
||||
$photo_property_value = null;
|
||||
$photos_1080_property_values = [];
|
||||
$photos_480_property_values = [];
|
||||
$photos_120_property_values = [];
|
||||
|
||||
foreach($images AS $k => $image)
|
||||
{
|
||||
$saved_file_id_1080 = resize_image($image, $code."_".($k + 1)."_1080", 1440, 1080, 60);
|
||||
$saved_file_id_480 = resize_image($image, $code."_".($k + 1)."_480", 640, 480, 60);
|
||||
$saved_file_id_120 = resize_image($image, $code."_".($k + 1)."_120", 160, 120, 60);
|
||||
|
||||
$photos_1080_property_values[] = [ "VALUE" => $saved_file_id_1080, ];
|
||||
$photos_480_property_values[] = [ "VALUE" => $saved_file_id_480, ];
|
||||
$photos_120_property_values[] = [ "VALUE" => $saved_file_id_120, ];
|
||||
|
||||
if($k === 0)
|
||||
{
|
||||
$photo_property_value = resize_image($image, $code."_".($k + 1)."_500", 500, 300, 60);
|
||||
}
|
||||
}
|
||||
|
||||
print "photos_property_values\n\n";
|
||||
print_r($photos_property_values);
|
||||
|
||||
CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTO", $photo_property_value);
|
||||
CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_1080", $photos_1080_property_values);
|
||||
CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_480", $photos_480_property_values);
|
||||
CIBlockElement::SetPropertyValueCode($new_used_car_id, "PHOTOS_120", $photos_120_property_values);
|
||||
}
|
||||
|
||||
print "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
//обновляем имеющуюся запись в bitrix восстанавливая из скрытого состояния
|
||||
$cars_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_USED, "CODE" => $code ], false, [], [] );
|
||||
while($car_search_ob = $cars_search_res->GetNextElement())
|
||||
{
|
||||
$car_existed = $car_search_ob->GetFields();
|
||||
|
||||
$el = new CIBlockElement;
|
||||
$el->Update($car_existed['ID'], ["ACTIVE" => "Y", "NAME" => $name, "SORT" => 500]);
|
||||
}
|
||||
}
|
||||
|
||||
$c++;
|
||||
}
|
||||
|
||||
//скрываем предложения, которые есть в bitrix но которых более нет в api
|
||||
foreach($bitrix_cars AS $code => $car_id)
|
||||
{
|
||||
print "CAR ".$code." => ".$car_id."\n";
|
||||
if(!in_array($code, $api_cars))
|
||||
{
|
||||
$el = new CIBlockElement;
|
||||
$el->Update($car_id, ["ACTIVE" => "N", "SORT" => 1]);
|
||||
}
|
||||
}
|
||||
|
||||
//скрываем марки, которые есть в bitrix но которых более нет в api
|
||||
foreach($bitrix_existed_brands AS $brand_id)
|
||||
{
|
||||
print "BRAND ".$ibrand_idd."\n";
|
||||
if(!in_array($brand_id, $api_existed_brands))
|
||||
{
|
||||
$el = new CIBlockElement;
|
||||
$el->Update($brand_id, ["ACTIVE" => "N"]);
|
||||
}
|
||||
}
|
||||
|
||||
//скрываем модели, которые есть в bitrix но которых более нет в api
|
||||
foreach($bitrix_existed_models AS $model_id)
|
||||
{
|
||||
print "MODEL ".$model_id."\n";
|
||||
if(!in_array($model_id, $api_existed_models))
|
||||
{
|
||||
$el = new CIBlockElement;
|
||||
$el->Update($model_id, ["ACTIVE" => "N"]);
|
||||
}
|
||||
}
|
||||
30
local/zerof.php
Normal file
30
local/zerof.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?
|
||||
$key = "9jV7aBR9iq49A3IVprDy";
|
||||
$key_sha1 = strtoupper(sha1($key, false));
|
||||
print "key_sha1: ".$key_sha1;
|
||||
print "\n";
|
||||
|
||||
$string_to_sign = "";
|
||||
$string_to_sign .= "GET\n";
|
||||
$string_to_sign .= "\n";
|
||||
$string_to_sign .= gmdate('D, d M Y H:i:s T')."\n";
|
||||
//$string_to_sign .= "Mon, 05 Jun 2023 09:12:12 GMT\n";
|
||||
$string_to_sign .= "/v2/tasks/find";
|
||||
|
||||
print "\nstring to sign\n";
|
||||
print $string_to_sign;
|
||||
print "\n\n";
|
||||
|
||||
$data = mb_convert_encoding($string_to_sign, mb_detect_encoding($string_to_sign), "UTF-8");
|
||||
print "\n\n\n";
|
||||
print "[data:\n";
|
||||
print $data;
|
||||
print "\n]";
|
||||
print "\n";
|
||||
|
||||
$hash = hash_hmac("SHA1", $data, $key_sha1, false);
|
||||
$base64 = base64_encode(hex2bin($hash));
|
||||
print "hash: ".$hash;
|
||||
print "\n\n";
|
||||
print "base64: ".$base64."\n\n";
|
||||
?>
|
||||
@ -187,7 +187,6 @@ $arUrlRewrite=array (
|
||||
'SORT' => 15,
|
||||
),
|
||||
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/car/([a-zA-Z0-9_-]+)/(\\?(.*))?$#',
|
||||
'RULE' => 'OFFER=$1',
|
||||
@ -196,6 +195,58 @@ $arUrlRewrite=array (
|
||||
'SORT' => 16,
|
||||
),
|
||||
|
||||
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/used/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/page-([0-9]+)/\\??.*$#',
|
||||
'RULE' => 'BRAND=$1&MODEL=$2&PAGEN_1=$3',
|
||||
'ID' => '',
|
||||
'PATH' => '/used/index.php',
|
||||
'SORT' => 11,
|
||||
),
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/used/([a-zA-Z0-9_-]+)/page-([0-9]+)/\\??.*$#',
|
||||
'RULE' => 'BRAND=$1&PAGEN_1=$2',
|
||||
'ID' => '',
|
||||
'PATH' => '/used/index.php',
|
||||
'SORT' => 12,
|
||||
),
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/used/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/(\\?(.*))?$#',
|
||||
'RULE' => 'BRAND=$1&MODEL=$2',
|
||||
'ID' => '',
|
||||
'PATH' => '/used/index.php',
|
||||
'SORT' => 13,
|
||||
),
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/used/page-([0-9]+)/\\??.*$#',
|
||||
'RULE' => 'PAGEN_1=$1',
|
||||
'ID' => '',
|
||||
'PATH' => '/used/index.php',
|
||||
'SORT' => 14,
|
||||
),
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/used/([a-zA-Z0-9_-]+)/(\\?(.*))?$#',
|
||||
'RULE' => 'BRAND=$1',
|
||||
'ID' => '',
|
||||
'PATH' => '/used/index.php',
|
||||
'SORT' => 15,
|
||||
),
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/izt/([a-zA-Z0-9_-]+)/(\\?(.*))?$#',
|
||||
'RULE' => 'OFFER=$1',
|
||||
'ID' => '',
|
||||
'PATH' => '/used/position.php',
|
||||
'SORT' => 16,
|
||||
),
|
||||
|
||||
|
||||
|
||||
array (
|
||||
'CONDITION' => '#^/about/career/page-([0-9]+)/\\??.*$#',
|
||||
'RULE' => 'PAGEN_1=$1',
|
||||
|
||||
3
used/.section.php
Normal file
3
used/.section.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?
|
||||
$sSectionName="С пробегом";
|
||||
?>
|
||||
58
used/index.php
Normal file
58
used/index.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?
|
||||
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
|
||||
$APPLICATION->SetTitle("Лизинг б/у автомобилей с пробегом для юридических лиц и ИП в Москве - купить подержанные машины в лизинг | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Каталог б/у автомобилей с пробегом в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить подержанные машины в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии 8 (800) 333-75-75 - звонок по России бесплатный.");
|
||||
$APPLICATION->SetPageProperty("keywords", "Лизинг бу автомобилей, автомобили с пробегом в лизинг, лизинг подержанных автомобилей");
|
||||
|
||||
?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent("bitrix:breadcrumb", "evolution", Array(
|
||||
"PATH" => "",
|
||||
"SITE_ID" => "s1",
|
||||
"START_FROM" => "0",
|
||||
),
|
||||
false
|
||||
);
|
||||
?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:used.catalog",
|
||||
isset($_REQUEST['ajax']) ? "ajax" : "",
|
||||
array(
|
||||
"PAGINATION" => "Y",
|
||||
"COUNT_PER_PAGE" => 12,
|
||||
"BRAND" => $_REQUEST['BRAND'],
|
||||
"MODEL" => $_REQUEST['MODEL'],
|
||||
"MODIFICATION" => $_REQUEST['MODIFICATION'],
|
||||
"DRIVE" => $_REQUEST['DRIVE'],
|
||||
"BODY" => $_REQUEST['BODY'],
|
||||
"BODY_SLUG" => $_REQUEST['BODY_SLUG'],
|
||||
"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'],
|
||||
|
||||
"VEHICLE_TYPE" => $_REQUEST['VEHICLE_TYPE'],
|
||||
"VEHICLE_SUBTYPE" => $_REQUEST['VEHICLE_SUBTYPE'],
|
||||
"PARKING_CITY" => $_REQUEST['PARKING_CITY'],
|
||||
"MILEAGE_FROM" => $_REQUEST['MILEAGE_FROM'],
|
||||
"MILEAGE_TO" => $_REQUEST['MILEAGE_TO'],
|
||||
"YEAR_FROM" => $_REQUEST['YEAR_FROM'],
|
||||
"YEAR_TO" => $_REQUEST['YEAR_TO'],
|
||||
|
||||
"SORT" => $_REQUEST['SORT'],
|
||||
"PATH" => "/used/",
|
||||
"PROGRAM" => null,
|
||||
)
|
||||
);
|
||||
?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:form.leasing",
|
||||
"",
|
||||
Array()
|
||||
);
|
||||
?>
|
||||
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
|
||||
58
used/landing.php
Normal file
58
used/landing.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?
|
||||
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
|
||||
$APPLICATION->SetTitle("Новые автомобили в лизинг");
|
||||
?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent("bitrix:breadcrumb", "evolution", Array(
|
||||
"PATH" => "",
|
||||
"SITE_ID" => "s1",
|
||||
"START_FROM" => "0",
|
||||
),
|
||||
false
|
||||
);
|
||||
?>
|
||||
|
||||
<?
|
||||
$params = [
|
||||
"PAGINATION" => "Y",
|
||||
"COUNT_PER_PAGE" => 12,
|
||||
"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" => "/catalog/",
|
||||
"PROGRAM" => null,
|
||||
"LANDING" => true,
|
||||
];
|
||||
|
||||
foreach($_REQUEST AS $k => $v)
|
||||
{
|
||||
if(strpos($k, "_SLUG"))
|
||||
{
|
||||
$params = array_merge($params, [ $k => $v ]);
|
||||
}
|
||||
}
|
||||
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.landing.".$_REQUEST['TYPE'],
|
||||
"",
|
||||
$params,
|
||||
);
|
||||
?>
|
||||
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:form.leasing",
|
||||
"",
|
||||
Array()
|
||||
);
|
||||
?>
|
||||
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
|
||||
41
used/position.php
Normal file
41
used/position.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?
|
||||
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
|
||||
$APPLICATION->AddChainItem("Подержанные автомобили", "/used/");
|
||||
?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent("bitrix:breadcrumb", "evolution", Array(
|
||||
"PATH" => "",
|
||||
"SITE_ID" => "s1",
|
||||
"START_FROM" => "0",
|
||||
),
|
||||
false
|
||||
);
|
||||
?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:used.catalog.position",
|
||||
"",
|
||||
[
|
||||
"OFFER" => $OFFER,
|
||||
"initial_payment" => 20,
|
||||
"lease_period" => 15,
|
||||
"redemption_payment" => 5,
|
||||
"CAR_PRICE_MIN" => 100000,
|
||||
"CAR_PRICE_MAX" => 20000000,
|
||||
"INITIAL_PAYMENT_MIN" => 5,
|
||||
"INITIAL_PAYMENT_MAX" => 50,
|
||||
"LEASE_PERIOD_MIN" => 7,
|
||||
"LEASE_PERIOD_MAX" => 60,
|
||||
"REDEMPTION_PAYMENT_MIN" => 1,
|
||||
"REDEMPTION_PAYMENT_MAX" => 5,
|
||||
]
|
||||
);
|
||||
?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:form.leasing.used",
|
||||
"",
|
||||
Array()
|
||||
);
|
||||
?>
|
||||
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
|
||||
Loading…
x
Reference in New Issue
Block a user