$PROP = array ("model"=>$key3,"features"=>array("VALUE"=>array("TEXT"=>$description[0],"TYPE"=>"html")),"vendor"=>$vendor[1],"goodcode"=>$code[1]);
$arLoadProductArray = Array(
"IBLOCK_SECTION_ID" => $add2,
"IBLOCK_ID" => 14,
"PROPERTY_VALUES"=> $PROP,
"NAME" => $key3,
"ACTIVE" => "Y",
"PREVIEW_PICTURE"=>CFile::MakeFileArray($_SERVER["DOCUMENT_ROOT"]."/upload/".$name_img)
);
$el = new CIBlockElement;
if($PRODUCT_ID = $el->Add($arLoadProductArray))
echo "New ID: ".$PRODUCT_ID;
else
echo "Error: ".$el->LAST_ERROR;
}
|