Answer the question
In order to leave comments, you need to log in
Why doesn't it add a price using CPrice::Add?
Hello.
The task is to write down the price for the product without TP.
If the price was, rewrite, if not, add:
$arPrice = Array("PRODUCT_ID" => $ar_fields["ID"], "PRICE" => $ar_fields["PROPERTY_PRICE_EXPO_VALUE"], "CURRENCY" => "RUB");
$cp = new CPrice;
$rs = $cp->GetList(array(), array("PRODUCT_ID" => $ar_fields["ID"]), false, false, array("ID"));
if ($rs->SelectedRowsCount() > 0)
{
$ar = $rs->GetNext();
$cp->Update($ar["ID"], $arPrice);
}
else
{
$cp->Add($arPrice);
}
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