R
R
run1822018-02-07 16:57:06
1C-Bitrix
run182, 2018-02-07 16:57:06

How to add values ​​to the Tags property in Bitrix?

CModule::IncludeModule("iblock");
$el = new CIBlockElement;
$arLoadProductArray = Array(
    "IBLOCK_ID"      => 1,
    "NAME"           => $_POST["NAME_COMPANY"],
    "TAGS" => $POST["TAGS"]
);
if($PRODUCT_ID = $el->Add($arLoadProductArray))
    echo "<p class=\"ok\">New ID: ".$PRODUCT_ID."</p>";
else
    echo "<p class=\"error\">Error: ".$el->LAST_ERROR."</p>";

I add to the list of parameters for adding TAGS - it displays an error "The tags field is not filled". How to add it? I didn't find anything in the manuals.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Epifanov, 2018-02-07
@run182

you have a typo in your code. should be written instead . And the CIBlockElement::Add method is used correctly $POST["TAGS"]$_POST["TAGS"]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question