Answer the question
In order to leave comments, you need to log in
Why is the product unavailable after adding?
There is a code that adds a product to the product catalog
and immediately after that the product is added to the order basket
$el = new \CIBlockElement;
$arFields = [
"CREATED_BY" => $USER->GetID(),
"MODIFIED_BY" => $USER->GetID(),
"ACTIVE" => 'Y',
"IBLOCK_SECTION_ID" => $_POST['NewProduct']['SECTION_ID'],
"IBLOCK_ID" => CATALOG_ID,
"NAME" => trim($_POST['NewProduct']['NAME']),
"SORT" => 100,
];
$productId = $el->Add($arFields);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question