Commit 61234b47 authored by Kulya's avatar Kulya 😊

Upd alvbx add prods7

parent 999200b8
...@@ -359,9 +359,12 @@ class AloVoiceRest ...@@ -359,9 +359,12 @@ class AloVoiceRest
if(empty($data)){ if(empty($data)){
return false; return false;
} }
$conf = self::get_billzconf(); $conf = self::get_billzconf();
$currency = 'UZS'; $currency = 'UZS';
$result = false; $result = false;
if(!empty($conf["bx_catalog_id"])){ if(!empty($conf["bx_catalog_id"])){
$arProduct = []; $arProduct = [];
...@@ -387,7 +390,7 @@ class AloVoiceRest ...@@ -387,7 +390,7 @@ class AloVoiceRest
"name" => $data["name"], "name" => $data["name"],
"code" => $this->translit($data["name"]), "code" => $this->translit($data["name"]),
"xmlId" => $xmlId, "xmlId" => $xmlId,
"iblockSectionId" => (!empty($data["price"])) ? $data["sid"] : 0, "iblockSectionId" => (!empty($data["sid"])) ? $data["sid"] : 0,
"quantity" => (!empty($data["qty"])) ? $data["qty"] : 0, "quantity" => (!empty($data["qty"])) ? $data["qty"] : 0,
"quantityTrace" => 'N', "quantityTrace" => 'N',
]; ];
...@@ -429,6 +432,8 @@ class AloVoiceRest ...@@ -429,6 +432,8 @@ class AloVoiceRest
if($ik==0){ if($ik==0){
$arNewProductParams["previewPicture"] = $arPic; $arNewProductParams["previewPicture"] = $arPic;
$arPic["value"]["fileData"][1] = 'data:image/' . $arImage["extension"] . ';base64,' . $arImage["base64"];
$arNewProductParams["detailPicture"] = $arPic;
} }
elseif($ik==1){ elseif($ik==1){
$arNewProductParams["detailPicture"] = $arPic; $arNewProductParams["detailPicture"] = $arPic;
...@@ -437,6 +442,8 @@ class AloVoiceRest ...@@ -437,6 +442,8 @@ class AloVoiceRest
} }
} }
BillzRest::setLog($arNewProductParams);
$arProduct = BxRest::call('catalog.product.add',["fields"=>$arNewProductParams]); $arProduct = BxRest::call('catalog.product.add',["fields"=>$arNewProductParams]);
} }
} }
...@@ -455,6 +462,7 @@ class AloVoiceRest ...@@ -455,6 +462,7 @@ class AloVoiceRest
$return = [ $return = [
'name' => $arInfo["basename"], 'name' => $arInfo["basename"],
'base64' => $data, 'base64' => $data,
'extension' => $arInfo["extension"],
]; ];
return $return; return $return;
......
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