Commit 820fca9c authored by Kulya's avatar Kulya 😊

Upd alvbx add sect3

parent 24d7b958
......@@ -485,12 +485,13 @@ class AloVoiceRest
if(!empty($conf["bx_catalog_id"])){
$addParams = [
"iblockId" => $conf["bx_catalog_id"],
"name" => $name,
"name" => translit($name),
// "code": 'news'
];
if(!empty($parent_id) && is_numeric($parent_id)){
$addParams["iblockSectionId"] = $parent_id;
}
var_dump($addParams);
$res = BxRest::call("catalog.section.add",["fields"=>$addParams]);
if(!empty($res["result"])){
$result = $res["result"];
......@@ -507,6 +508,23 @@ class AloVoiceRest
return $this->bx_add_product_section($r[0]);
}
private function translit($t=false) {
$cyr = array('а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у',
'ф','х','ц','ч','ш','щ','ъ', 'ы','ь', 'э', 'ю','я',
'А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У',
'Ф','Х','Ц','Ч','Ш','Щ','Ъ', 'Ы','Ь', 'Э', 'Ю','Я' );
$lat = array( 'a','b','v','g','d','e','e','zh','z','i','y','k','l','m','n','o','p','r','s','t','u',
'f' ,'h' ,'ts' ,'ch','sh' ,'sht' ,'i', 'y', 'y', 'e' ,'yu' ,'ya','A','B','V','G','D','E','E','Zh',
'Z','I','Y','K','L','M','N','O','P','R','S','T','U',
'F' ,'H' ,'Ts' ,'Ch','Sh' ,'Sht' ,'I' ,'Y' ,'Y', 'E', 'Yu' ,'Ya' );
$textlat = str_replace($cyr, $lat, $t);
// $textlat = str_replace($lat, $cyr, $textlat);
$textlat = str_replace(" ", "_", $textlat);
return $textlat;
}
private function billz_catalog_infos_synch_OLD($r=false) {
$p=1;
$ps=10;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment