19 private static bool $enableAutomaticReservation;
34 $extendedMode = ($extendedMode ===
true);
38 ReserveCondition::ON_CREATE =>
Loc::getMessage(
'SALE_CONFIGURATION_RESERVE_ON_CREATE'),
39 ReserveCondition::ON_FULL_PAY =>
Loc::getMessage(
'SALE_CONFIGURATION_RESERVE_ON_FULL_PAY'),
40 ReserveCondition::ON_PAY =>
Loc::getMessage(
'SALE_CONFIGURATION_RESERVE_ON_PAY'),
41 ReserveCondition::ON_ALLOW_DELIVERY =>
Loc::getMessage(
'SALE_CONFIGURATION_RESERVE_ON_ALLOW_DELIVERY'),
42 ReserveCondition::ON_SHIP =>
Loc::getMessage(
'SALE_CONFIGURATION_RESERVE_ON_SHIP')
46 ReserveCondition::ON_CREATE,
47 ReserveCondition::ON_FULL_PAY,
48 ReserveCondition::ON_PAY,
49 ReserveCondition::ON_ALLOW_DELIVERY,
50 ReserveCondition::ON_SHIP
63 if (!isset($settings))
65 $settings = ReservationSettingsService::getInstance()->get();
79 return self::getReservationSettings()->getReserveCondition();
87 if (!isset(self::$enableAutomaticReservation))
89 self::$enableAutomaticReservation = self::getReservationSettings()->isEnableAutomaticReservation();
91 return self::$enableAutomaticReservation;
96 self::$enableAutomaticReservation =
true;
101 self::$enableAutomaticReservation =
false;
112 return self::getReservationSettings()->getClearPeriod();
122 $condition = static::getProductReservationCondition();
123 return in_array($condition, array(ReserveCondition::ON_SHIP, ReserveCondition::ON_ALLOW_DELIVERY));
134 if (Loader::includeModule(
'bitrix24'))
136 $lang = \CBitrix24::getLicensePrefix();
138 elseif (Loader::includeModule(
'intranet'))
140 $lang = \CIntranetUtils::getPortalZone();
143 return in_array($lang, [
'ru',
'ua',
'by',
'kz'],
true);
154 if (Loader::includeModule(
'bitrix24'))
156 $lang = \CBitrix24::getLicensePrefix();
158 elseif (Loader::includeModule(
'intranet'))
160 $lang = \CIntranetUtils::getPortalZone();
163 return in_array($lang, [
'ru',
'ua',
'by',
'kz'],
true);
174 if (Loader::includeModule(
'bitrix24'))
176 $lang = \CBitrix24::getLicensePrefix();
178 elseif (Loader::includeModule(
'intranet'))
180 $lang = \CIntranetUtils::getPortalZone();
183 return in_array($lang, [
'ru',
'ua',
'by',
'kz'],
true);
194 $registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
195 $optionClassName = $registry->get(Registry::ENTITY_OPTIONS);
197 return ((
string)$optionClassName::get(
'sale',
'allow_deduction_on_delivery') ===
'Y');
208 $condition = static::getAllowDeliveryOnPayCondition();
209 return in_array($condition, array(static::ALLOW_DELIVERY_ON_PAY, ReserveCondition::ON_ALLOW_DELIVERY));
218 $registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
219 $optionClassName = $registry->get(Registry::ENTITY_OPTIONS);
221 return $optionClassName::get(
'sale',
'status_on_change_allow_delivery_after_paid');
234 self::ALLOW_DELIVERY_ON_PAY =>
Loc::getMessage(
'SALE_CONFIGURATION_ON_PAY'),
235 self::ALLOW_DELIVERY_ON_FULL_PAY =>
Loc::getMessage(
'SALE_CONFIGURATION_ON_FULL_PAY'),
239 self::ALLOW_DELIVERY_ON_PAY,
240 self::ALLOW_DELIVERY_ON_FULL_PAY,
249 $registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
250 $optionClassName = $registry->get(Registry::ENTITY_OPTIONS);
252 return $optionClassName::get(
'sale',
'status_on_paid_condition');
260 $registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
261 $optionClassName = $registry->get(Registry::ENTITY_OPTIONS);
263 return $optionClassName::get(
'sale',
'status_on_paid_condition');
273 if (!Loader::includeModule(
'catalog'))
276 return Catalog\Config\State::isUsedInventoryManagement();
286 !Loader::includeModule(
'catalog')
287 || !self::useStoreControl()
293 return (
int)Catalog\StoreTable::getDefaultStoreId();
304 $registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
305 $optionClassName = $registry->get(Registry::ENTITY_OPTIONS);
307 return ((
string)$optionClassName::get(
'catalog',
'enable_reservation') ===
'Y');
316 $registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
317 $optionClassName = $registry->get(Registry::ENTITY_OPTIONS);
319 return $optionClassName::get(
'sale',
'discount_separately_calculation') ===
'Y';
static loadMessages($file)
static getMessage($code, $replace=null, $language=null)
static isAvailableOrdersImportFromB24()
static disableAutomaticReservation()
const ALLOW_DELIVERY_ON_FULL_PAY
static getDefaultStoreId()
const ALLOW_DELIVERY_ON_PAY
static getProductReserveClearPeriod()
static isEnableAutomaticReservation()
static isCanUsePersonalization()
static getAllowDeliveryOnPayCondition()
static isAllowedSeparatelyDiscountCalculation()
static getStatusPaidCondition()
static enableAutomaticReservation()
static getReservationConditionList($extendedMode=false)
static getAllowDeliveryAfterPaidConditionList($extendedMode=false)
static isEnabledReservation()
static getStatusAllowDeliveryCondition()
static needShipOnAllowDelivery()
static needAllowDeliveryOnPay()
static getProductReservationCondition()
static isReservationDependsOnShipment()