6if (!Loader::includeModule(
'catalog'))
9Loc::loadMessages(__FILE__);
61 'USE_BASE_PRICE' =>
$order[
'USE_BASE_PRICE'],
62 'SITE_ID' =>
$order[
'SITE_ID'],
63 'CURRENCY' =>
$order[
'CURRENCY']
95 return (isset($row[self::BASKET_APPLIED_FIELD]));
111 if (empty($basket) || !is_array($basket))
114 foreach ($basket as $itemId => $value)
116 foreach (
$order[
'BASKET_ITEMS'] as &$basketRow)
118 if (isset($basketRow[
'ID']) && $basketRow[
'ID'] == $itemId)
122 $basketRow[self::BASKET_APPLIED_FIELD] = $value;
128 unset($value, $itemId);
131 self::setManualMode(
$order);
146 foreach (
$order[
'BASKET_ITEMS'] as &$basketRow)
149 if (array_key_exists(self::BASKET_APPLIED_FIELD, $basketRow))
151 unset($basketRow[self::BASKET_APPLIED_FIELD]);
184 $extMode = ($extMode ===
true);
244 if (
$arParams[
'ID'] != static::GetControlID())
248 'ATOMS' => static::GetAtomsEx(
false,
true),
254 public static function Parse($arOneCondition)
256 if (!isset($arOneCondition[
'controlId']))
258 if ($arOneCondition[
'controlId'] != static::GetControlID())
261 'ID' => $arOneCondition[
'controlId'],
262 'ATOMS' => static::GetAtomsEx(
false,
true),
265 return static::CheckAtoms($arOneCondition, $arOneCondition, $arControl,
false);
273 return 'CumulativeAction';
278 return new \Bitrix\Main\EventResult(
280 static::getControlDescr() +
array(
'GROUP' =>
'Y',
'EXECUTE_MODULE' =>
'sale'),
285 public static function IsGroup($strControlID =
false)
292 if (empty($oneCondition[
'ranges']) || !is_array($oneCondition[
'ranges']))
297 $filterCode =
'null';
298 if ($subs && is_array($subs))
300 $filterCode = static::buildSubsCode($subs, $oneCondition);
303 $rangesAsString = var_export($oneCondition[
'ranges'],
true);
305 static::convertSumConfigurationDateToInt($oneCondition[
'sum_period_data']);
307 $configurationAsString = var_export(
309 'sum' => $oneCondition,
310 'apply_if_more_profitable' => $oneCondition[
'apply_if_more_profitable'],
316 return "\\Bitrix\\Sale\\Discount\\Actions::applyCumulativeToBasket({$params['ORDER']}, {$rangesAsString}, {$configurationAsString}, {$filterCode})";
321 if ($oneCondition[
'All'] ==
'AND')
325 $itemPrefix = ($oneCondition[
'True'] ==
'True' ?
'' :
'!');
330 if ($oneCondition[
'True'] ==
'True')
342 $commandLine = $itemPrefix . implode($logic . $itemPrefix, $subs);
345 $commandLine = $prefix .
'(' . $commandLine .
')';
348 $code =
"function(\$row){
349 return ({$commandLine});
361 if (isset($periodData[
'discount_sum_order_start']))
363 static::ConvertDateTime2Int(
364 $periodData[
'discount_sum_order_start'],
366 \CTimeZone::getOffset()
370 if (isset($periodData[
'discount_sum_order_end']))
372 static::ConvertDateTime2Int(
373 $periodData[
'discount_sum_order_end'],
375 \CTimeZone::getOffset()
390 $arControls =
array();
397 'controlId' => static::GetControlID(),
401 'showIn' => static::GetShowIn(
$arParams[
'SHOW_IN_GROUPS']),
414 'controlId' => static::GetControlID(),
419 public static function Parse($arOneCondition)
428 if (!empty($arSubs) && is_array($arSubs))
429 return 'function (&'.$arParams[
'ORDER'].
'){'.implode(
'; ',$arSubs).
';};';
446 return 'GiftCondGroup';
451 return static::GetAtomsEx(
false,
false);
454 public static function GetAtomsEx($strControlID =
false, $boolEx =
false)
456 $boolEx = (
true === $boolEx ? true :
false);
457 $arAtomList =
array();
461 foreach ($arAtomList as &$arOneAtom)
463 $arOneAtom = $arOneAtom[
'JS'];
465 if (isset($arOneAtom))
474 $controlDescr = parent::GetControlDescr();
475 $controlDescr[
'FORCED_SHOW_LIST'] =
array(
476 'GifterCondIBElement',
477 'GifterCondIBSection',
479 $controlDescr[
'SORT'] = 300;
481 return $controlDescr;
487 'controlId' => static::GetControlID(),
489 'containsOneAction' =>
true,
492 'showIn' => static::GetShowIn(
$arParams[
'SHOW_IN_GROUPS']),
499 'DELETE_CONTROL' =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_DELETE_CONTROL')
504 public static function Parse($arOneCondition)
518 if (!isset($arSubs) || !is_array($arSubs) || empty($arSubs))
524 $mxResult =
'\Bitrix\Sale\Discount\Actions::applySimpleGift(' .
$arParams[
'ORDER'] .
', ' . implode(
'; ',$arSubs) .
');';
537 (empty(
$fields[
'ACTIONS_LIST']) || !is_array(
$fields[
'ACTIONS_LIST']))
540 $actions = unserialize(
$fields[
'ACTIONS'], [
'allowed_classes' =>
false]);
544 $actions =
$fields[
'ACTIONS_LIST'];
547 if (!is_array($actions) || empty($actions) || empty($actions[
'CHILDREN']))
552 $giftCondGroups =
array();
553 foreach($actions[
'CHILDREN'] as $child)
555 if(isset($child[
'CLASS_ID']) && isset($child[
'DATA']) && $child[
'CLASS_ID'] === static::GetControlID())
558 $giftCondGroups[] = reset($child[
'CHILDREN']);
563 $giftsData =
array();
564 foreach($giftCondGroups as $child)
567 if(isset($child[
'CLASS_ID']) && isset($child[
'DATA']))
569 $gifter = static::getGifter($child);
574 $giftsData[] = $gifter->ProvideGiftData($child);
584 if(in_array(
$data[
'CLASS_ID'],
array(
'GifterCondIBElement',
'GifterCondIBSection')))
609 if (
$arParams[
'ID'] != static::GetControlID())
613 'ATOMS' => static::GetAtomsEx(
false,
true)
619 public static function Parse($arOneCondition)
621 if (!isset($arOneCondition[
'controlId']))
623 if ($arOneCondition[
'controlId'] != static::GetControlID())
626 'ID' => $arOneCondition[
'controlId'],
627 'ATOMS' => static::GetAtomsEx(
false,
true)
630 return static::CheckAtoms($arOneCondition, $arOneCondition, $arControl,
false);
649 'style' =>
'condition-logic-and',
653 'style' =>
'condition-logic-or',
673 return 'ActSaleDelivery';
678 $arAtoms = static::GetAtomsEx(
false,
false);
679 $boolCurrency =
false;
680 if (static::$boolInit)
682 if (isset(static::$arInitParams[
'CURRENCY']))
684 $arAtoms[
'Unit'][
'values'][
'Cur'] = static::$arInitParams[
'CURRENCY'];
685 $boolCurrency =
true;
687 elseif (isset(static::$arInitParams[
'SITE_ID']))
690 if (!empty($strCurrency))
692 $arAtoms[
'Unit'][
'values'][
'Cur'] = $strCurrency;
693 $boolCurrency =
true;
699 unset($arAtoms[
'Unit'][
'values'][
'Cur']);
702 'controlId' => static::GetControlID(),
706 'showIn' => static::GetShowIn(
$arParams[
'SHOW_IN_GROUPS']),
714 'DELETE_CONTROL' =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_DELETE_CONTROL')
723 return static::GetAtomsEx(
false,
false);
726 public static function GetAtomsEx($strControlID =
false, $boolEx =
false)
728 $boolEx = (
true === $boolEx ? true :
false);
736 'Discount' =>
Loc::getMessage(
'BT_SALE_ACT_DELIVERY_SELECT_TYPE_DISCOUNT'),
737 'DiscountZero' =>
Loc::getMessage(
'BT_SALE_ACT_DELIVERY_SELECT_TYPE_DISCOUNT_ZERO'),
740 'defaultText' =>
Loc::getMessage(
'BT_SALE_ACT_DELIVERY_SELECT_TYPE_DEF'),
741 'defaultValue' =>
'Discount',
742 'first_option' =>
'...'
746 'FIELD_TYPE' =>
'string',
747 'FIELD_LENGTH' => 255,
755 'name' =>
'extra_size',
760 'FIELD_TYPE' =>
'double',
768 'name' =>
'extra_unit',
774 'defaultText' =>
Loc::getMessage(
'BT_SALE_ACT_DELIVERY_SELECT_UNIT_DEF'),
775 'defaultValue' =>
'Perc',
776 'first_option' =>
'...'
780 'FIELD_TYPE' =>
'string',
781 'FIELD_LENGTH' => 255,
790 foreach ($arAtomList as &$arOneAtom)
792 $arOneAtom = $arOneAtom[
'JS'];
794 if (isset($arOneAtom))
810 if (is_string($arControl))
812 if ($arControl == static::GetControlID())
815 'ID' => static::GetControlID(),
816 'ATOMS' => static::GetAtoms()
820 $boolError = !is_array($arControl);
824 $arOneCondition[
'Value'] = (float)$arOneCondition[
'Value'];
826 'VALUE' => ($arOneCondition[
'Type'] ==
'Extra' ? $arOneCondition[
'Value'] : -$arOneCondition[
'Value']),
829 if ($arOneCondition[
'Type'] ==
'DiscountZero' && $arOneCondition[
'Unit'] ==
'Cur')
832 $mxResult =
'\Bitrix\Sale\Discount\Actions::applyToDelivery('.$arParams[
'ORDER'].
', '.var_export(
$actionParams,
true).
')';
844 $controlDescr = parent::GetControlDescr();
846 $controlDescr[
'PARENT'] =
true;
847 $controlDescr[
'EXIST_HANDLER'] =
'Y';
848 $controlDescr[
'MODULE_ID'] =
'catalog';
849 $controlDescr[
'MODULE_ENTITY'] =
'iblock';
850 $controlDescr[
'ENTITY'] =
'ELEMENT';
851 $controlDescr[
'FIELD'] =
'ID';
853 return $controlDescr;
858 return 'ActSaleGift';
863 $arAtoms = static::GetAtomsEx(
false,
false);
864 if (static::$boolInit)
869 'controlId' => static::GetControlID(),
873 'showIn' => static::GetShowIn(
$arParams[
'SHOW_IN_GROUPS']),
877 $arAtoms[
'GiftValue'],
886 return static::GetAtomsEx(
false,
false);
889 public static function GetAtomsEx($strControlID =
false, $boolEx =
false)
891 $boolEx = (
true === $boolEx ? true :
false);
902 'defaultText' =>
Loc::getMessage(
'BT_SALE_ACT_GIFT_SELECT_TYPE_SELECT_DEF'),
903 'defaultValue' =>
'one',
904 'first_option' =>
'...'
908 'FIELD_TYPE' =>
'string',
909 'FIELD_LENGTH' => 255,
914 'GiftValue' =>
array(
917 'name' =>
'gifts_value',
918 'type' =>
'multiDialog',
919 'popup_url' =>
'/bitrix/tools/sale/product_search_dialog.php',
920 'popup_params' =>
array(
921 'lang' => LANGUAGE_ID,
922 'caller' =>
'discount'
931 'EXIST_HANDLER' =>
'Y',
932 'MODULE_ID' =>
'catalog',
933 'MODULE_ENTITY' =>
'iblock',
934 'ENTITY' =>
'ELEMENT',
937 'FIELD_TYPE' =>
'int',
938 'VALIDATE' =>
'element',
939 'PHP_VALUE' =>
array(
940 'VALIDATE' =>
'element'
948 foreach ($arAtomList as &$arOneAtom)
950 $arOneAtom = $arOneAtom[
'JS'];
952 if (isset($arOneAtom))
967 if (is_string($arControl) && $arControl == static::GetControlID())
970 'ID' => static::GetControlID(),
971 'ATOMS' => static::GetAtoms()
974 $boolError = !is_array($arControl);
978 $arControl[
'ATOMS'] = static::GetAtomsEx($arControl[
'ID'],
true);
985 $stringArray =
'array(' . implode(
',', array_map(
'intval', $arOneCondition[
'GiftValue'])) .
')';
986 $type = $arOneCondition[
'Type'];
988 $mxResult =
"CSaleDiscountActionApply::ApplyGiftDiscount({$arParams['ORDER']}, $stringArray, '{$type}');";
997 (empty(
$fields[
'ACTIONS_LIST']) || !is_array(
$fields[
'ACTIONS_LIST']))
1000 $actions = unserialize(
$fields[
'ACTIONS'], [
'allowed_classes' =>
false]);
1004 $actions =
$fields[
'ACTIONS_LIST'];
1007 if (!is_array($actions) || empty($actions) || empty($actions[
'CHILDREN']))
1013 foreach($actions[
'CHILDREN'] as $child)
1045 return 'ActSaleBsktGrp';
1050 $arAtoms = static::GetAtomsEx(
false,
false);
1051 $boolCurrency =
false;
1052 if (static::$boolInit)
1054 if (isset(static::$arInitParams[
'CURRENCY']))
1056 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_CURRENCY] = str_replace(
1058 static::$arInitParams[
'CURRENCY'],
1059 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_CURRENCY]
1061 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_SUMM] = str_replace(
1063 static::$arInitParams[
'CURRENCY'],
1064 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_SUMM]
1066 $boolCurrency =
true;
1068 elseif (isset(static::$arInitParams[
'SITE_ID']))
1071 if (!empty($strCurrency))
1073 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_CURRENCY] = str_replace(
1076 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_CURRENCY]
1078 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_SUMM] = str_replace(
1081 $arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_SUMM]
1083 $boolCurrency =
true;
1089 unset($arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_CURRENCY]);
1090 unset($arAtoms[
'Unit'][
'values'][self::VALUE_UNIT_SUMM]);
1093 'controlId' => static::GetControlID(),
1096 'defaultText' =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_DEF_TEXT'),
1097 'showIn' => static::GetShowIn(
$arParams[
'SHOW_IN_GROUPS']),
1098 'visual' => static::GetVisual(),
1113 'DELETE_CONTROL' =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_DELETE_CONTROL')
1121 if (!isset($arOneCondition[
'Max']))
1123 $arOneCondition[
'Max'] = 0;
1126 $result = parent::CheckAtoms($arOneCondition,
$arParams, $arControl, $boolShow);
1131 if (
$result[
'values'][
'Unit'] === self::VALUE_UNIT_SUMM && !empty(
$result[
'values'][
'Max']))
1134 $result[
'fatal_err_cond'] =
'Y';
1135 if (!isset(
$result[
'err_cond_mess']))
1138 $result[
'err_cond_mess'] .=
'. '.Loc::getMessage(
'BT_SALE_ACT_MAX_DISCOUNT_ON_GROUP_BASKET_ERROR_CONDITION');
1153 return parent::GetConditionShow(
$arParams);
1159 'controls' =>
array(
1183 'style' =>
'condition-logic-and',
1187 'style' =>
'condition-logic-and',
1191 'style' =>
'condition-logic-or',
1195 'style' =>
'condition-logic-or',
1209 return static::GetAtomsEx(
false,
false);
1212 public static function GetAtomsEx($strControlID =
false, $boolEx =
false)
1214 $boolEx = (
true === $boolEx ? true :
false);
1215 $arAtomList =
array(
1222 self::ACTION_TYPE_DISCOUNT =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_TYPE_DISCOUNT'),
1223 self::ACTION_TYPE_EXTRA =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_TYPE_EXTRA'),
1224 self::ACTION_TYPE_CLOSEOUT =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_TYPE_CLOSEOUT_EXT')
1226 'defaultText' =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_TYPE_DEF'),
1227 'defaultValue' => self::ACTION_TYPE_DISCOUNT,
1228 'first_option' =>
'...'
1232 'FIELD_TYPE' =>
'string',
1233 'FIELD_LENGTH' => 255,
1235 'VALIDATE' =>
'list'
1241 'name' =>
'extra_size',
1246 'FIELD_TYPE' =>
'double',
1254 'name' =>
'extra_unit',
1257 self::VALUE_UNIT_PERCENT =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_PERCENT'),
1258 self::VALUE_UNIT_CURRENCY =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_CUR_EACH'),
1259 self::VALUE_UNIT_SUMM =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_CUR_ALL')
1261 'defaultText' =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_UNIT_DEF'),
1262 'defaultValue' => self::VALUE_UNIT_PERCENT,
1263 'first_option' =>
'...'
1267 'FIELD_TYPE' =>
'string',
1268 'FIELD_LENGTH' => 255,
1270 'VALIDATE' =>
'list'
1276 'name' =>
'max_value',
1281 'FIELD_TYPE' =>
'int',
1289 'name' =>
'aggregator',
1295 'defaultText' =>
Loc::getMessage(
'BT_SALE_ACT_GROUP_BASKET_SELECT_DEF'),
1296 'defaultValue' =>
'AND',
1297 'first_option' =>
'...'
1301 'FIELD_TYPE' =>
'string',
1302 'FIELD_LENGTH' => 255,
1304 'VALIDATE' =>
'list'
1317 'defaultValue' =>
'True',
1318 'first_option' =>
'...'
1322 'FIELD_TYPE' =>
'string',
1323 'FIELD_LENGTH' => 255,
1325 'VALIDATE' =>
'list'
1332 foreach ($arAtomList as &$arOneAtom)
1333 $arOneAtom = $arOneAtom[
'JS'];
1346 if (!isset($arOneCondition[
'Max']))
1347 $arOneCondition[
'Max'] = 0;
1349 foreach (static::GetAtomsEx(
false,
false) as $atom)
1352 if (!isset($arOneCondition[$atom[
'id']]) )
1357 if (!isset($arSubs) || !is_array($arSubs))
1365 switch ($arOneCondition[
'Unit'])
1367 case self::VALUE_UNIT_PERCENT:
1370 case self::VALUE_UNIT_CURRENCY:
1373 case self::VALUE_UNIT_SUMM:
1382 $discountParams = [];
1385 $arOneCondition[
'Value'] = (float)$arOneCondition[
'Value'];
1386 switch ($arOneCondition[
'Type'])
1388 case self::ACTION_TYPE_DISCOUNT:
1390 'VALUE' => -$arOneCondition[
'Value'],
1392 'LIMIT_VALUE' => $arOneCondition[
'Max'],
1395 case self::ACTION_TYPE_EXTRA:
1397 'VALUE' => $arOneCondition[
'Value'],
1402 case self::ACTION_TYPE_CLOSEOUT:
1406 'VALUE' => $arOneCondition[
'Value'],
1424 if (!empty($arSubs))
1426 $filter =
'$saleact'.$arParams[
'FUNC_ID'];
1428 if ($arOneCondition[
'All'] ==
'AND')
1432 $itemPrefix = ($arOneCondition[
'True'] ==
'True' ?
'' :
'!');
1437 if ($arOneCondition[
'True'] ==
'True')
1449 $commandLine = $itemPrefix.implode($logic.$itemPrefix, $arSubs);
1451 $commandLine = $prefix.
'('.$commandLine.
')';
1453 $mxResult =
$filter.
'=function($row){';
1454 $mxResult .=
'return ('.$commandLine.
');';
1456 $mxResult .=
'\Bitrix\Sale\Discount\Actions::applyToBasket('.$arParams[
'ORDER'].
', '.var_export($discountParams,
true).
', '.
$filter.
');';
1461 $mxResult =
'\Bitrix\Sale\Discount\Actions::applyToBasket('.$arParams[
'ORDER'].
', '.var_export($discountParams,
true).
', "");';
1463 unset($discountParams, $unit);
1473 'COND' => $mxResult,
1476 if($arOneCondition[
'Unit'] === self::VALUE_UNIT_SUMM)
1478 $result[
'OVERWRITE_CONTROL'] =
array(
'EXECUTE_MODULE' =>
'sale');
1496 return 'ActSaleSubGrp';
1533 foreach ($arControlList as &
$control)
1536 $control[
'EXECUTE_MODULE'] =
'sale';
1539 return static::searchControl($arControlList, $strControlID);
1556 parent::__construct();
1561 parent::__destruct();
1566 if (!isset(
$params[
'SYSTEM_MESSAGES']) || !is_array(
$params[
'SYSTEM_MESSAGES']))
1567 $params[
'SYSTEM_MESSAGES'] = [];
1568 if (!isset(
$params[
'SYSTEM_MESSAGES'][
'SELECT_CONTROL']))
1570 if (!isset(
$params[
'SYSTEM_MESSAGES'][
'ADD_CONTROL']))
1579 $this->arExecuteFunc =
array();
1580 $this->usedModules =
array();
1581 $this->usedExtFiles =
array();
1582 $this->usedEntity =
array();
1583 $this->executeModule =
array();
1584 if (!$this->boolError)
1594 $this->boolError =
true;
1603 $this->boolError =
true;
1605 if (!$this->boolError)
1607 $strFinal = preg_replace(
"#;{2,}#",
";", $strResult);
1620 $boolFirst = ($boolFirst ===
true);
1621 if (empty($arLevel) || !is_array($arLevel))
1633 if (!empty($arLevel[
'CLASS_ID']))
1636 if ($arLevel[
'CLASS_ID'] !== $defaultBlock[
'CLASS_ID'])
1640 if (isset($this->arControlList[$arLevel[
'CLASS_ID']]))
1642 $arOneControl = $this->arControlList[$arLevel[
'CLASS_ID']];
1643 if ($arOneControl[
'GROUP'] ==
'Y')
1646 $arSubParams[
'FUNC_ID'] .=
'_'.$intRowNum;
1647 $arSubEval = $this->
GenerateLevel($arLevel[
'CHILDREN'], $arSubParams);
1648 if ($arSubEval ===
false || !is_array($arSubEval))
1651 $arGroupParams[
'FUNC_ID'] .=
'_'.$intRowNum;
1652 $mxEval = call_user_func_array($arOneControl[
'Generate'],
1653 array($arLevel[
'DATA'], $arGroupParams, $arLevel[
'CLASS_ID'], $arSubEval)
1655 if (is_array($mxEval))
1657 if (isset($mxEval[
'FUNC']))
1659 $this->arExecuteFunc[] = $mxEval[
'FUNC'];
1661 $strEval = (isset($mxEval[
'COND']) ? $mxEval[
'COND'] :
false);
1670 $strEval = call_user_func_array($arOneControl[
'Generate'],
1674 if ($strEval ===
false || !is_string($strEval) || $strEval ===
'false')
1685 foreach ($arLevel as $arOneCondition)
1688 if (!empty($arOneCondition[
'CLASS_ID']))
1690 if (isset($this->arControlList[$arOneCondition[
'CLASS_ID']]))
1692 $arOneControl = $this->arControlList[$arOneCondition[
'CLASS_ID']];
1693 if ($arOneControl[
'GROUP'] ==
'Y')
1696 $arSubParams[
'FUNC_ID'] .=
'_'.$intRowNum;
1697 $arSubEval = $this->
GenerateLevel($arOneCondition[
'CHILDREN'], $arSubParams);
1698 if ($arSubEval ===
false || !is_array($arSubEval))
1701 $arGroupParams[
'FUNC_ID'] .=
'_'.$intRowNum;
1702 $mxEval = call_user_func_array($arOneControl[
'Generate'],
1703 array($arOneCondition[
'DATA'], $arGroupParams, $arOneCondition[
'CLASS_ID'], $arSubEval)
1705 if (is_array($mxEval))
1707 if (isset($mxEval[
'FUNC']))
1709 $this->arExecuteFunc[] = $mxEval[
'FUNC'];
1711 $strEval = (isset($mxEval[
'COND']) ? $mxEval[
'COND'] :
false);
1720 $strEval = call_user_func_array($arOneControl[
'Generate'],
1721 array($arOneCondition[
'DATA'],
$arParams, $arOneCondition[
'CLASS_ID'])
1724 if ($strEval ===
false || !is_string($strEval) || $strEval ===
'false')
1730 if(!empty($mxEval[
'OVERWRITE_CONTROL']) && is_array($mxEval[
'OVERWRITE_CONTROL']))
1732 $arOneControl = array_merge($arOneControl, array_intersect_key($mxEval[
'OVERWRITE_CONTROL'],
array(
1733 'EXECUTE_MODULE' =>
true,
1742 unset($arOneCondition);
1749 if ($value ==
'' || $value ==
'()')
1761 return (!empty($this->executeModule) ? array_keys($this->executeModule) :
array());
1767 if (!empty(
$control[
'EXECUTE_MODULE']))
1768 $this->executeModule[
$control[
'EXECUTE_MODULE']] =
true;
static getMessage($code, $replace=null, $language=null)
static filterBasketForAction(array $item)
static applyToDelivery(array &$order, array $action)
const GIFT_SELECT_TYPE_ALL
const BASKET_APPLIED_FIELD
static applySimpleGift(array &$order, $filter)
static setUseMode($mode, array $config=array())
static applyToBasket(array &$order, array $action, $filter)
const GIFT_SELECT_TYPE_ONE
const VALUE_TYPE_CLOSEOUT
static getSiteCurrency($siteId)
static ExtendProductIds(array $giftedProductIds)
static GetShowIn($arControls)
const CONTROL_ID_APPLIED_DISCOUNT
static GetControls($strControlID=false)
static GetConditionShow($arParams)
static Parse($arOneCondition)
const VALUE_UNIT_CURRENCY
static GetConditionShow($arParams)
static Generate($arOneCondition, $arParams, $arControl, $arSubs=false)
static CheckAtoms($arOneCondition, $arParams, $arControl, $boolShow)
static GetShowIn($arControls)
const ACTION_TYPE_DISCOUNT
static GetAtomsEx($strControlID=false, $boolEx=false)
const ACTION_TYPE_CLOSEOUT
static GetControlShow($arParams)
static Generate($arOneCondition, $arParams, $arControl, $arSubs=false)
static GetShowIn($arControls)
static GetAtomsEx($strControlID=false, $boolEx=false)
static GetControlShow($arParams)
static GetConditionShow($arParams)
static Generate($arOneCondition, $arParams, $arControl, $arSubs=false)
static GetShowIn($arControls)
static Parse($arOneCondition)
static GetControlShow($arParams)
static GetConditionShow($arParams)
static Parse($arOneCondition)
static GetShowIn($arControls)
static GetControlShow($params)
static ProvideGiftProductData(array $fields)
static Generate($arOneCondition, $arParams, $arControl, $arSubs=false)
static getGifter(array $data)
static ExtendProductIds(array $productIds)
static GetShowIn($arControls)
static Parse($arOneCondition)
static GetAtomsEx($strControlID=false, $boolEx=false)
static GetControlShow($arParams)
static Generate($arOneCondition, $arParams, $arControl, $arSubs=false)
static GetShowIn($arControls)
static getGiftDataByDiscount($fields)
static GetAtomsEx($strControlID=false, $boolEx=false)
static GetControlShow($arParams)
GenerateLevel(&$arLevel, $arParams, $boolFirst=false)
Generate($arConditions, $arParams)
Init($mode, $event, $params=array())
static GetControls($strControlID=false)
const ENTITY_BASKET_POSITION_ACTION_APPLIED
static convertSumConfigurationDateToInt(&$periodData=array())
static buildSubsCode(array $subs, array $oneCondition)
static onBuildDiscountActionInterfaceControls()
static IsGroup($strControlID=false)
static Generate($oneCondition, $params, $control, $subs=false)
static isManualMode($order)
static filterApplied($row)
static clearManualMode(&$order)
static setManualMode(&$order)
const GIFT_SELECT_TYPE_ALL
const BASKET_APPLIED_FIELD
static ApplyDelivery(&$order, $value, $unit, $extMode=false)
static clearBasketApplied(&$order)
static ApplyBasketDiscount(&$order, $func, $value, $unit)
static $getPercentFromBasePrice
const GIFT_SELECT_TYPE_ONE
static fillBasketApplied(&$order, $basket)
const ORDER_MANUAL_MODE_FIELD
static ApplyGiftDiscount(&$order, $callableFilter)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
CheckSerializedData($str, $max_depth=200)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']