Answer the question
In order to leave comments, you need to log in
How to fill in the base price of a product in Bitrix via API?
Here is the code:
$PRICE_TYPE_ID = 1;
$arFields = Array(
"PRODUCT_ID" => $PRODUCT_ID,
"CATALOG_GROUP_ID" => $PRICE_TYPE_ID,
"PRICE" => 500,
"CURRENCY" => "RUB",
"QUANTITY_FROM" => 0,
"QUANTITY_TO" => 999
);
$res = CPrice::GetList(array(), array("PRODUCT_ID" => $PRODUCT_ID, "CATALOG_GROUP_ID" => $PRICE_TYPE_ID));
if ($arr = $res->Fetch()) {
CPrice::Update($arr["ID"], $arFields);
} else {
$idPrice = CPrice::Add($arFields);
//CCatalogGroup::Update($idPrice, Array("BASE" => "Y"));
}
//CPrice::SetBasePrice($PRODUCT_ID, $arFieldsRow[2], "RUB", 0);
//CCatalogProduct::Update($PRODUCT_ID, array('WEIGTH' => $arFieldsRow[3]));
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