sitemap aggregation programms fixes

This commit is contained in:
merelendor 2025-01-12 15:12:27 +03:00
parent ed0a48ef06
commit 43d3f83e7f

View File

@ -2632,7 +2632,7 @@ if(!in_array("simulate", $GLOBALS['argv']))
while($sitemap_program_aggregations_brand_ob = $sitemap_program_aggregations_brands->GetNextElement()) while($sitemap_program_aggregations_brand_ob = $sitemap_program_aggregations_brands->GetNextElement())
{ {
$sitemap_program_aggregations_brand = $sitemap_program_aggregations_brand_ob->GetFields(); $sitemap_program_aggregations_brand = $sitemap_program_aggregations_brand_ob->GetFields();
$sitemap_program_aggregations_string .= "<url><loc>".$url."/".$program['ROOT_CHUNK']."/".$sitemap_program_aggregations_brand['CODE']."/"."</loc><lastmod>".$lastmod."</lastmod></url>"."\n"; $sitemap_program_aggregations_string .= "<url><loc>".$url."/".$program['ROOT_CHUNK']."/brand-".$sitemap_program_aggregations_brand['CODE']."/"."</loc><lastmod>".$lastmod."</lastmod></url>"."\n";
$sitemap_program_aggregations_brand_types = CIBlockElement::GetList([ "NAME" => "ASC" ], [ "IBLOCK_ID" => $program['RULES_ID'], "PROPERTY_VEHICLE_BRAND" => $sitemap_program_aggregations_brand['ID'], "ACTIVE" => "Y" ], false, [ "nTopCount" => 1000 ], [], ); $sitemap_program_aggregations_brand_types = CIBlockElement::GetList([ "NAME" => "ASC" ], [ "IBLOCK_ID" => $program['RULES_ID'], "PROPERTY_VEHICLE_BRAND" => $sitemap_program_aggregations_brand['ID'], "ACTIVE" => "Y" ], false, [ "nTopCount" => 1000 ], [], );
while($sitemap_program_aggregations_type_ob = $sitemap_program_aggregations_brand_types->GetNextElement()) while($sitemap_program_aggregations_type_ob = $sitemap_program_aggregations_brand_types->GetNextElement())
@ -2643,11 +2643,12 @@ if(!in_array("simulate", $GLOBALS['argv']))
if(!empty($sitemap_program_aggregations_brand_type['PROPERTIES']['VEHICLE_TYPE']['VALUE'])) if(!empty($sitemap_program_aggregations_brand_type['PROPERTIES']['VEHICLE_TYPE']['VALUE']))
{ {
$sitemap_program_aggregations_brand_type_related = get_related($program['ROOT_ID'], $sitemap_program_aggregations_brand_type['PROPERTIES']['VEHICLE_TYPE']['VALUE']); $sitemap_program_aggregations_brand_type_related = get_related($program['ROOT_ID'], $sitemap_program_aggregations_brand_type['PROPERTIES']['VEHICLE_TYPE']['VALUE']);
$sitemap_program_aggregations_string .= "<url><loc>".$url."/".$program['ROOT_CHUNK']."/".$sitemap_program_aggregations_brand['CODE']."/".$sitemap_program_aggregations_brand_type_related['CODE']."/"."</loc><lastmod>".$lastmod."</lastmod></url>"."\n"; $sitemap_program_aggregations_string .= "<url><loc>".$url."/".$program['ROOT_CHUNK']."/brand-".$sitemap_program_aggregations_brand['CODE']."/".$sitemap_program_aggregations_brand_type_related['CODE']."/"."</loc><lastmod>".$lastmod."</lastmod></url>"."\n";
} }
} }
} }
} }
$sitemap_program_aggregations_string .= "</urlset>"."\n";
file_put_contents($_SERVER['DOCUMENT_ROOT']."/sitemap-programs.xml", $sitemap_program_aggregations_string); file_put_contents($_SERVER['DOCUMENT_ROOT']."/sitemap-programs.xml", $sitemap_program_aggregations_string);