From e944d8081d0ada96caf340a18cd45c67ac66d2ba Mon Sep 17 00:00:00 2001 From: merelendor Date: Tue, 14 May 2024 20:25:27 +0300 Subject: [PATCH] change IBLOCK_ID source to Bitrix's dbconn file constants --- local/ilsa.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/local/ilsa.php b/local/ilsa.php index f33f795..cd7297d 100644 --- a/local/ilsa.php +++ b/local/ilsa.php @@ -183,7 +183,7 @@ function models_check($bitrix_models, $bitrix_modifications, $brand_uid, $brand) $CODE = CUtil::translit( $NAME, "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] ); //"ID" - $modification_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => 10, "CODE" => $CODE ], false, ["nPageSize" => 1], [] ); + $modification_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS, "CODE" => $CODE ], false, ["nPageSize" => 1], [] ); while($modification_search_ob = $modification_search_res->GetNextElement()) { $m_res = $modification_search_ob->GetFields(); @@ -197,7 +197,7 @@ function models_check($bitrix_models, $bitrix_modifications, $brand_uid, $brand) if($modification_existed === null) { $modification_element = new CIBlockElement; - $modification_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => 10, "PROPERTY_VALUES" => [ "MODEL_UID" => $model_uid, "TITLE" => $modification ], "NAME" => $NAME, "CODE" => $CODE, "ACTIVE" => "Y", ]; + $modification_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS, "PROPERTY_VALUES" => [ "MODEL_UID" => $model_uid, "TITLE" => $modification ], "NAME" => $NAME, "CODE" => $CODE, "ACTIVE" => "Y", ]; if($new_modification_id = $modification_element->Add($modification_payload)) { @@ -258,7 +258,7 @@ foreach($json AS $car) //"ID" $car_existed = null; - $car_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => 1, "PROPERTY_UID" => $car['uid'] ], false, ["nPageSize" => 1], [] ); + $car_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "PROPERTY_UID" => $car['uid'] ], false, ["nPageSize" => 1], [] ); while($car_search_ob = $car_search_res->GetNextElement()) { @@ -278,7 +278,7 @@ foreach($json AS $car) //if($c === 0) //{ $car_element = new CIBlockElement; - $car_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => 1, "NAME" => $name, "CODE" => $code, "PROPERTY_VALUES" => $PROPERTY_VALUES, "ACTIVE" => "Y", ]; + $car_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "NAME" => $name, "CODE" => $code, "PROPERTY_VALUES" => $PROPERTY_VALUES, "ACTIVE" => "Y", ]; if($new_car_id = $car_element->Add($car_payload)) {