Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
percentprice.php
1
<?php
2
3
namespace
Bitrix\Sale\Services\PaySystem\Restrictions
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Sale\PriceMaths
;
7
8
Loc::loadMessages
(__FILE__);
9
10
class
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
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\PriceMaths
Definition
pricemaths.php:8
Bitrix\Sale\PriceMaths\roundPrecision
static roundPrecision($value)
Definition
pricemaths.php:16
Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice
Definition
percentprice.php:11
Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice\getClassTitle
static getClassTitle()
Definition
percentprice.php:28
Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice\getClassDescription
static getClassDescription()
Definition
percentprice.php:36
Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice\getPrice
static getPrice($entityParams, $paramValue)
Definition
percentprice.php:17
Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice\getOnApplyErrorMessage
static getOnApplyErrorMessage()
Definition
percentprice.php:41
Bitrix\Sale\Services\PaySystem\Restrictions\PercentPrice\getParamsStructure
static getParamsStructure($entityId=0)
Definition
percentprice.php:51
Bitrix\Sale\Services\PaySystem\Restrictions\Price
Definition
price.php:16
Bitrix\Sale\Services\PaySystem\Restrictions
Definition
concreteproduct.php:3
modules
sale
lib
services
paysystem
restrictions
percentprice.php
Создано системой
1.10.0