Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
percentprice.php
1<?php
2
4
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 loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static roundPrecision($value)