2namespace Bitrix\Sale\Delivery\Services;
4use Bitrix\Sale\Delivery\Restrictions;
33 "SID" =>
'new'.$this->service->getId(),
34 "NAME" => $this->service->getName(),
35 "DESCRIPTION" => $this->service->getDescription(),
36 "DESCRIPTION_INNER" =>
"DESCRIPTION_INNER",
37 "BASE_CURRENCY" => $this->service->getCurrency(),
38 "HANDLER" => self::HANDLER,
41 "COMPABILITY" =>
array($this,
"compatibility"),
42 "CALCULATOR" =>
array($this,
"calculate"),
63 $shipment = \CSaleDelivery::convertOrderOldToNew($arOrder);
65 if($this->service->isCompatible($shipment))
79 public function calculate($profile, $arConfig, $arOrder,
$STEP, $TEMP =
false)
81 $res = $this->service->calculate(
82 \CSaleDelivery::convertOrderOldToNew($arOrder)
86 "VALUE" =>
$res->getPrice(),
87 "TRANSIT" =>
$res->getPeriodDescription(),
88 "RESULT" =>
$res->isSuccess() ?
"OK" :
"ERROR",
106 if (is_null($newService))
111 $service[
"SID"] =
'new'.$service[
"ID"];
116 $service[
"HANDLER"] = self::HANDLER;
118 if (intval(
$service[
"LOGOTIP"]) > 0)
122 "CONFIG_GROUPS" =>
array(),
128 $profileParams =
array(
130 "DESCRIPTION" =>
$service[
"DESCRIPTION"],
137 foreach($restrictions as $restriction)
139 switch($restriction[
"CLASS_NAME"])
141 case '\Bitrix\Sale\Delivery\Restrictions\ByWeight':
142 $profileParams[
"RESTRICTIONS_WEIGHT"] =
array($restriction[
"PARAMS"][
"MIN_WEIGHT"], $restriction[
"PARAMS"][
"MAX_WEIGHT"]);
145 case '\Bitrix\Sale\Delivery\Restrictions\ByPrice':
146 $profileParams[
"RESTRICTIONS_SUM"] =
array($restriction[
"PARAMS"][
"MIN_PRICE"], $restriction[
"PARAMS"][
"MAX_PRICE"]);
149 case '\Bitrix\Sale\Delivery\Restrictions\ByDimensions':
150 $profileParams[
"RESTRICTIONS_DIMENSIONS"] =
array(
151 $restriction[
"PARAMS"][
"LENGTH"],
152 $restriction[
"PARAMS"][
"WIDTH"],
153 $restriction[
"PARAMS"][
"HEIGHT"]
156 $profileParams[
"RESTRICTIONS_MAX_SIZE"] = $restriction[
"PARAMS"][
"MAX_DIMENSION"];
157 $profileParams[
"RESTRICTIONS_DIMENSIONS_SUM"] = $restriction[
"PARAMS"][
"MAX_DIMENSIONS_SUM"];
165 $service[
"PROFILES"][
'profile'] = $profileParams;
167 $newToAutomatic =
new self($newService);
static getObjectById($deliveryId)
calculate($profile, $arConfig, $arOrder, $STEP, $TEMP=false)
__construct(Base $service)
compatibility($arOrder, $arConfig)
static convertNewServiceToOld($service)
static getRestrictionsList($serviceId)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)