Commit fe8a0e54 authored by Kulya's avatar Kulya 😊

Upd alvbx add prods15

parent 9eac0cab
...@@ -457,18 +457,27 @@ class AloVoiceRest ...@@ -457,18 +457,27 @@ class AloVoiceRest
BillzRest::setLog($arNewProductParams); BillzRest::setLog($arNewProductParams);
if(empty($arProduct)){ if(empty($arProduct)){
$arProduct = BxRest::call('catalog.product.add',["fields"=>$arNewProductParams]); $arAddRes = BxRest::call('catalog.product.add',["fields"=>$arNewProductParams]);
if(!empty($arAddRes["result"]["element"])){
$arProduct = $arAddRes["result"]["element"];
}
} }
else { else {
var_dump($result["result"]["products"][0]); echo '--------------------';
$arProduct = BxRest::call('catalog.product.update',["id"=>$result["result"]["products"][0]["ID"] ,"fields"=>$arNewProductParams]); var_dump($arProduct);
echo '--------------------';
$arUpdRes = BxRest::call('catalog.product.update',["id"=>$arProduct["id"] ,"fields"=>$arNewProductParams]);
echo '**********************';
var_dump($arUpdRes);
echo '*********************';
} }
if(!empty($arProduct["result"]["element"]["id"]) && !empty($data["price"])){ if(!empty($arProduct["id"]) && !empty($data["price"])){
$arProdPrice = [ $arProdPrice = [
"product" => [ "product" => [
"id" => $arProduct["result"]["element"]["id"], "id" => $arProduct["id"],
"prices" => [ "prices" => [
[ [
"catalogGroupId" => $priceType, "catalogGroupId" => $priceType,
......
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