1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
percentprice.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Services\PaySystem\Restrictions;
4
5use Bitrix\Main\Localization\Loc;
6use Bitrix\Sale\PriceMaths;
7
8Loc::loadMessages(__FILE__);
9
10class PercentPrice extends Price
11{
17 protected static function getPrice($entityParams, $paramValue)
18 {
19 $percent = (float)$paramValue / 100;
20 $price = (float)$entityParams['PRICE_ORDER'] * $percent;
21
22 return PriceMaths::roundPrecision($price);
23 }
24
28 public static function getClassTitle()
29 {
30 return Loc::getMessage('SALE_PS_RESTRICTIONS_BY_PERCENT_PRICE');
31 }
32
36 public static function getClassDescription()
37 {
38 return Loc::getMessage('SALE_PS_RESTRICTIONS_BY_PERCENT_PRICE_DESC');
39 }
40
41 public static function getOnApplyErrorMessage(): string
42 {
43 return Loc::getMessage('SALE_PS_RESTRICTIONS_BY_PERCENT_PRICE_ON_APPLY_ERROR_MSG');
44 }
45
51 public static function getParamsStructure($entityId = 0)
52 {
53 return array(
54 "MIN_VALUE" => array(
55 'TYPE' => 'NUMBER',
56 'DEFAULT' => 0,
57 'LABEL' => Loc::getMessage("SALE_PS_RESTRICTIONS_BY_PRICE_PERCENT_TYPE_MORE")
58 ),
59 "MAX_VALUE" => array(
60 'TYPE' => 'NUMBER',
61 'DEFAULT' => 0,
62 'LABEL' => Loc::getMessage("SALE_PS_RESTRICTIONS_BY_PRICE_PERCENT_TYPE_LESS")
63 )
64 );
65 }
66}
static roundPrecision($value)
Определения pricemaths.php:16
static getPrice($entityParams, $paramValue)
Определения percentprice.php:17
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$entityId
Определения payment.php:4