コード例 #1
0
 function it_removes_adjustments_from_order_recursively(OrderInterface $order)
 {
     $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT)->shouldBeCalled();
     $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT)->shouldBeCalled();
     $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT)->shouldBeCalled();
     $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT)->shouldBeCalled();
     $order->removeAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->shouldBeCalled();
     $this->removeFrom($order);
 }
コード例 #2
0
ファイル: AdjustmentsRemover.php プロジェクト: okwinza/Sylius
 /**
  * {@inheritdoc}
  */
 public function removeFrom(OrderInterface $order)
 {
     $adjustmentsToRemove = [AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT, AdjustmentInterface::TAX_ADJUSTMENT];
     foreach ($adjustmentsToRemove as $type) {
         $order->removeAdjustmentsRecursively($type);
     }
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function process(OrderInterface $order)
 {
     foreach (self::$adjustmentsToRemove as $type) {
         $order->removeAdjustmentsRecursively($type);
     }
 }