Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
currency.php
1
<?php
2
namespace
Bitrix\Sale\Services\Company\Restrictions
;
3
4
use
Bitrix\Currency\CurrencyManager
;
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Sale\Delivery\Restrictions
;
7
use
Bitrix\Sale\Internals
;
8
use
Bitrix\Sale
;
9
use
Bitrix\Sale\PaymentCollection
;
10
use
Bitrix\Sale\ShipmentCollection
;
11
use
Bitrix\Sale\Services\Base
;
12
13
Loc::loadMessages
(__FILE__);
14
19
class
Currency
extends
Base\Restriction
20
{
25
protected
static
function
extractParams
(Internals\
Entity
$entity)
26
{
27
if
($entity instanceof Internals\
CollectableEntity
)
28
{
30
$collection = $entity->getCollection();
31
33
$order = $collection->getOrder();
34
}
35
elseif ($entity instanceof
Sale
\
Order
)
36
{
38
$order = $entity;
39
}
40
41
if
(!$order)
42
return
false
;
43
44
return
$order->getCurrency();
45
}
46
50
public
static
function
getClassTitle
()
51
{
52
return
Loc::getMessage
(
'SALE_COMPANY_RULES_BY_CURRENCY_TITLE'
);
53
}
54
58
public
static
function
getClassDescription
()
59
{
60
return
Loc::getMessage
(
'SALE_COMPANY_RULES_BY_CURRENCY_DESC'
);
61
}
62
67
public
static
function
getParamsStructure
($entityId = 0)
68
{
69
return
array(
70
"CURRENCY"
=> array(
71
"TYPE"
=>
"ENUM"
,
72
'MULTIPLE'
=>
'Y'
,
73
"LABEL"
=>
Loc::getMessage
(
"SALE_COMPANY_RULES_BY_CURRENCY"
),
74
"OPTIONS"
=> CurrencyManager::getCurrencyList()
75
)
76
);
77
}
78
85
public
static
function
check
($params, array $restrictionParams, $serviceId = 0)
86
{
87
if
(isset($restrictionParams) && is_array($restrictionParams[
'CURRENCY'
]))
88
return
in_array($params, $restrictionParams[
'CURRENCY'
]);
89
90
return
true
;
91
}
92
}
Bitrix\Catalog\Model\Entity
Definition
entity.php:12
Bitrix\Currency\CurrencyManager
Definition
currencymanager.php:15
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\Helpers\Order
Definition
order.php:10
Bitrix\Sale\Internals\CollectableEntity
Definition
collectableentity.php:14
Bitrix\Sale\PaymentCollection
Definition
paymentcollection.php:18
Bitrix\Sale\Services\Base\Restriction\extractParams
static extractParams(Entity $entity)
Definition
restriction.php:115
Bitrix\Sale\Services\Company\Restrictions\Currency
Definition
currency.php:20
Bitrix\Sale\Services\Company\Restrictions\Currency\check
static check($params, array $restrictionParams, $serviceId=0)
Definition
currency.php:85
Bitrix\Sale\Services\Company\Restrictions\Currency\getClassTitle
static getClassTitle()
Definition
currency.php:50
Bitrix\Sale\Services\Company\Restrictions\Currency\getClassDescription
static getClassDescription()
Definition
currency.php:58
Bitrix\Sale\Services\Company\Restrictions\Currency\getParamsStructure
static getParamsStructure($entityId=0)
Definition
currency.php:67
Bitrix\Sale\ShipmentCollection
Definition
shipmentcollection.php:20
Bitrix\Sale\Delivery\Restrictions
Definition
base.php:2
Bitrix\Sale\Internals
Definition
accountnumber.php:3
Bitrix\Sale\Services\Base
Definition
concreteproductrestriction.php:3
Bitrix\Sale\Services\Company\Restrictions
Definition
currency.php:2
Bitrix\Sale
Sale
modules
sale
lib
services
company
restrictions
currency.php
Создано системой
1.10.0