Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/yandex.market/lib/export/promo/rule/ |
Upload File : |
<?php namespace Yandex\Market\Export\Promo\Rule; use Bitrix\Main; use Yandex\Market; class SetPrice extends Simple { public static function apply($rule, $price, $currency) { $currency = (string)$currency; $discountCurrency = (string)$rule['DISCOUNT_CURRENCY']; $discountPrice = (float)$rule['DISCOUNT_PRICE']; $isMatchCurrency = ($currency === '' || $discountCurrency === '' || $currency === $discountCurrency); if (!$isMatchCurrency && Main\Loader::includeModule('currency')) { $precision = static::getPrecision($currency); $discountPrice = \CCurrencyRates::ConvertCurrency($discountPrice, $discountCurrency, $currency); $discountPrice = roundEx($discountPrice, $precision); } if ($discountPrice < $price) { $result = $discountPrice; } else { $result = $price; } return $result; } }