Answer the question
In order to leave comments, you need to log in
Updating/filling Bitrix price types?
Good afternoon! Please tell me, I'm trying to collect a subscription to an event when converting the exchange rate!
1. Added new Price types: USD, EUR
2. Therefore, the product has new price types: USD, EUR
Task: Update \ fill in these price types for the product when updating the exchange rate in terms of the base one at the established exchange rate.
In init.php I began to think something like
AddEventHandler("currency", "OnCurrencyRateUpdate", "CurrencyUpdate");
function CurrencyUpdate()
{
CModule::IncludeModule('iblock');
CModule::IncludeModule('catalog');
CModule::IncludeModule('currency');
$obElements = \Bitrix\Iblock\ElementTable::getList([
'select' => ["ID"],
'filter' => ["IBLOCK_ID" => 1]
]);
$el = new CIBlockElement;
while ($result = $obElements->fetch()) {
$el->Update($result["ID"], []);
}
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