Current Path : /home/bitrix/ext_www/klimatlend.ua/ajax/ |
Current File : /home/bitrix/ext_www/klimatlend.ua/ajax/comments.php |
<? require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); if(CModule::IncludeModule("iblock")){ $arFields=array(); $el = new CIBlockElement(); $arFields['NAME']=$_POST['NAME']; foreach ($_POST as $key=>$field){ $PROP[$key] = $field; } $arLoadProductArray = Array( "NAME" => $_POST['NAME'], "IBLOCK_ID" => 13, "PROPERTY_VALUES" => $PROP, "ACTIVE" => "N", "PREVIEW_TEXT" => $_POST["COMMENT"], ); $PRODUCT_ID = $el->Add($arLoadProductArray); $VALUES = array(); $res = CIBlockElement::GetProperty($_REQUEST["parent"], $_REQUEST["PRODUCT_ID"], "sort", "asc", array("CODE" => "COMMENT")); while ($ob = $res->GetNext()) { if (!empty($ob['VALUE'])) $VALUES[] = $ob['VALUE']; } $VALUES[]=$PRODUCT_ID; //$el->SetPropertyValueCode($_REQUEST["Good_id"], 'COMMENTS', $VALUES); CIBlockElement::SetPropertyValueCode($_REQUEST["PRODUCT_ID"],'COMMENT', $VALUES); }