Answer the question
In order to leave comments, you need to log in
Why is the price affixed but not shown on the site?
Hi all.
I have a shopping catalog, I'm trying to load a product from a CSV code:
$cat[] = ('724');
$PROP = array();
$detail_desc = $data[3] . "<BR>" . $data[10];
$previev_desc = $data[3];
$PROP['SSYLKA'] = $data[16];
$PROP['CML2_ARTICLE'] = $data[4];
$arLoadProductArray = Array(
"MODIFIED_BY" => $USER->GetID(), // элемент изменен текущим пользователем
"ACTIVE_FROM" => date('d.m.Y H:i:s'),
"IBLOCK_SECTION" => $cat,
"IBLOCK_ID" => 5,
"PROPERTY_VALUES"=> $PROP,
"NAME" => $data[8],
"CATALOG_QUANTITY" => 100,
"ACTIVE" => "Y", // активен
"PREVIEW_TEXT" => $previev_desc,
"DETAIL_TEXT" => $detail_desc,
"DETAIL_TEXT_TYPE" => 'html',
"PREVIEW_PICTURE" => CFile::MakeFileArray($data[11]),
"DETAIL_PICTURE" => CFile::MakeFileArray($data[11]),
"QUANTITY" => 100
);
if($PRODUCT_ID = $el->Add($arLoadProductArray)) {
echo "Создан : ".$PRODUCT_ID . "ID магазина: " . $data[4];
CPrice::SetBasePrice($PRODUCT_ID, $data[12], "RUB", 0);
}
Answer the question
In order to leave comments, you need to log in
https://blog.d-it.ru/dev/add-the-product-in-bitrix...
How to update the balance?
We can't do this:
CCatalogProduct::update($row['ID'], array('QUANTITY' => $fields['QUANTITY']));
Because the product may not yet be in the database (despite the fact that the element is already there).
We can do like this:
CCatalogProduct::add(array('ID' => $row['ID'], 'QUANTITY' => $fields['QUANTITY']));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question