There are simple products and product offers, all in different currencies. The "smart filter" shows the price range in only one currency; it does not notice other prices.

Is there any solution for correct operation? The use of MIN_PRICE not suitable, as it is only for product offers, it is not available in regular products.

Bitrix 15, "Small Business".

  • And what prevents to store in one currency? There is a currency module: dev.1c-bitrix.ru/user_help/settings/currency/index.php - ka3a
  • @ ka3a, the documentation has an example of calling a smart filter with the parameters CONVERT_CURRENCY and CURRENCY_ID. Does not work. Judging by user requests, the problem has been relevant since at least 2013. - user2892255
  • If it does not work, then I would have written in your place support. There's more likelihood that they will help you :) - ka3a
  • In my opinion, this is a direct road to hell: when the number of your goods grows to ten thousand, the smart filter will simply stop tossing and turning. - Andrewus

1 answer 1

For trade offers I did not try, but for ordinary goods in the template of the integrated component bitrix:catalog , before calling the component bitrix:catalog.section , I use the following code:

 if (CModule::IncludeModule('currency') && !empty($GLOBALS[$arParams["FILTER_NAME"]]) && ( !empty($GLOBALS[$arParams["FILTER_NAME"]]['>=CATALOG_PRICE_1']) || !empty($GLOBALS[$arParams["FILTER_NAME"]]['>=CATALOG_PRICE_1']) || !empty($GLOBALS[$arParams["FILTER_NAME"]]['><CATALOG_PRICE_1']) ) ) { if (!empty($GLOBALS[$arParams["FILTER_NAME"]]['><CATALOG_PRICE_1'])) { $GLOBALS[$arParams["FILTER_NAME"]]['>=CATALOG_PRICE_1'] = $GLOBALS[$arParams["FILTER_NAME"]]['><CATALOG_PRICE_1'][0]; $GLOBALS[$arParams["FILTER_NAME"]]['<=CATALOG_PRICE_1'] = $GLOBALS[$arParams["FILTER_NAME"]]['><CATALOG_PRICE_1'][1]; unset($GLOBALS[$arParams["FILTER_NAME"]]['><CATALOG_PRICE_1']); } $arCurrency = array(); $res = CCurrency::GetList($by = 'currency', $order = 'asc'); while ($arRes = $res->Fetch()) { $arCurrency[] = $arRes['CURRENCY']; } if (!empty($GLOBALS[$arParams["FILTER_NAME"]]['>=CATALOG_PRICE_1']) && count($arCurrency) > 1) { $arPriceFilter = array('LOGIC' => 'OR'); foreach ($arCurrency as $currency) { $price = floatval($GLOBALS[$arParams["FILTER_NAME"]]['>=CATALOG_PRICE_1']); if ($arParams['CURRENCY_ID'] != $currency) { $price = CCurrencyRates::ConvertCurrency($price, $arParams['CURRENCY_ID'], $currency); } $arPriceFilter[] = array( 'CATALOG_CURRENCY_1' => $currency, '>=CATALOG_PRICE_1' => $price, ); } $GLOBALS[$arParams["FILTER_NAME"]][] = $arPriceFilter; unset($arPriceFilter); unset($GLOBALS[$arParams["FILTER_NAME"]]['>=CATALOG_PRICE_1']); } if (!empty($GLOBALS[$arParams["FILTER_NAME"]]['<=CATALOG_PRICE_1']) && count($arCurrency) > 1) { $arPriceFilter = array('LOGIC' => 'OR'); foreach ($arCurrency as $currency) { $price = floatval($GLOBALS[$arParams["FILTER_NAME"]]['<=CATALOG_PRICE_1']); if ($arParams['CURRENCY_ID'] != $currency) { $price = CCurrencyRates::ConvertCurrency($price, $arParams['CURRENCY_ID'], $currency); } $arPriceFilter[] = array( 'CATALOG_CURRENCY_1' => $currency, '<=CATALOG_PRICE_1' => $price, ); } $GLOBALS[$arParams["FILTER_NAME"]][] = $arPriceFilter; unset($arPriceFilter); unset($GLOBALS[$arParams["FILTER_NAME"]]['<=CATALOG_PRICE_1']); } } 

Naturally, everything works out correctly only for the price type with ID = 1 , who needs another - change CATALOG_PRICE_1 and CATALOG_CURRENCY_1 to the ones you need.