예제 #1
0
 /**
  * @return Result
  * @throws Main\NotSupportedException
  */
 public function calculateDelivery()
 {
     if ($this->isSystem()) {
         throw new Main\NotSupportedException();
     }
     if ($this->getDeliveryId() == 0) {
         return new Delivery\CalculationResult();
     }
     /** @var Result $deliveryCalculate */
     $deliveryCalculate = Delivery\Services\Manager::calculate($this);
     if (!$deliveryCalculate->isSuccess()) {
         return $deliveryCalculate;
     }
     $data = $deliveryCalculate->getData();
     $data['AVAILABLE'] = Delivery\Services\Manager::checkServiceRestrictions($this->getDeliveryId(), $this);
     $deliveryCalculate->setData($data);
     return $deliveryCalculate;
 }
예제 #2
0
 /**
  * @param $profiles
  * @param \Bitrix\Sale\Shipment $shipment
  */
 public static function checkProfilesRestriction($profiles, $shipment)
 {
     foreach ($profiles as &$profile) {
         $profile['RESTRICTED'] = Services\Manager::checkServiceRestrictions($profile['ID'], $shipment);
     }
     unset($profile);
     return $profiles;
 }