Find OrderCoupon instances assigned to current order.

@param OrderInterface $order Order

@return OrderCouponInterface[] OrderCoupons
544300
public function findOrderCouponsByOrder(OrderInterface $order)
    {
        return $this
            ->createQueryBuilder('oc')
            ->where('oc.order = :order')
            ->setParameter('order', $order)
            ->getQuery()
            ->getResult();
    }
318162
private function getCurrentShippingMethodCostsCollection(OrderInterface $order) : Collection
    {
        return $this->methodProvider->getShippingMethodCosts($order->getShippingMethod(), new OrderContext($order));
    }
1299312
public function getMerchantOrderParams($orderIndex = 0)
    {
        $orderStatuses = $this->getOrderStatuses();
        return array_key_exists('merchantOrderParams', $orderStatuses[$orderIndex])
            ? $orderStatuses[$orderIndex]['merchantOrderParams'] : [];
    }
1138044
public function getOrderReference(TransactionInterface $transaction)
    {
        $order = $transaction->get('order', null);

        if ($this->getLogger()) {
            $this->getLogger()->notice(sprintf('[BasePaypalPayment::loadOrder] order=%s', $order));
        }

        return $order;
    }
1246750
protected function getAddress(OrderInterface $order)
    {
        $ret = $order->getBillingAddress1();
        if (null !== $order->getBillingAddress2()) {
            $ret .= ' '.$order->getBillingAddress2();
        }
        if (null !== $order->getBillingAddress3()) {
            $ret .= ' '.$order->getBillingAddress3();
        }

        return $ret;
    }
828718
protected function getItemBagForOrder(Order $order)
    {
        $itemBag = $this->createItemBagForOrder($order);

        $event = new ItemBagEvent([
            'items' => $itemBag,
            'order' => $order
        ]);
        $this->trigger(self::EVENT_AFTER_CREATE_ITEM_BAG, $event);

        return $event->items;
    }
130669
public function processCallback(OrderInterface $order, $action)
    {
        $params = [
            'bank' => $this->getCode(),
            'reference' => $order->getReference(),
            'check' => $this->generateUrlCheck($order),
            'action' => $action,
        ];

        $url = $this->router->generate($this->getOption('url_callback'), $params, UrlGeneratorInterface::ABSOLUTE_URL);

        $response = $this->browser->get($url);

        $routeName = 'ok' === $response->getContent() ? 'url_return_ok' : 'url_return_ko';

        $response = new RedirectResponse($this->router->generate($this->getOption($routeName), $params, true), 302, [
            'Content-Type' => 'text/plain',
        ]);
        $response->setPrivate();

        return $response;
    }
952918
protected function parseOrderWithModel(OrderInterface $order)
    {
        if ($this->hasModel()) {
            if ($order->hasProperty()) {
                $model    = $this->model();
                $property = $order->property();
                if (is_string($property) && $model->hasProperty($property)) {
                    $property = $model->property($property);

                    if ($property->l10n()) {
                        $order->setProperty($property->l10nIdent());
                    }
                }
            }

            if ($order instanceof OrderCollectionInterface) {
                $order->traverseOrders(function (OrderInterface $expr) {
                    $this->parseOrderWithModel($expr);
                });
            }
        }

        return $order;
    }
1182713
public function getTotalHubFeeForOrder(\HarvestCloud\CoreBundle\Entity\Order $order)
    {
        return ($order->getLineItemTotal() * $this->getSellerHubRef()->getVariableFee() / 100) + $this->getSellerHubRef()->getFixedFee();
    }
230772
public function dispatchAction(Order $order)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $order->dispatchBySeller($this->get('exchange_manager')->getExchange());

        $em->persist($order);
        $em->flush();

        $this->get('notifier')->notify(new OrderDispatchedBySellerEvent($order), $this->getUser());

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
882198
public function edit(Order $order)
    {
        Shop::instance($order->shop_id);
        $paymentMethods = Shop::getPaymentMethods()->flatten()->mapWithKeys(function($method) {
            return [$method::getId() => $method::getName()];
        })->all();
        return view('order::admin.orders.edit', compact('order', 'paymentMethods'));
    }
1287373
protected function buildOrderJoin(string $order): array
    {
        list($column, $direction) = $this->formatOrderDirection($order);

        $lookupBuilder = $this->getLookupBuilder();

        $column = $lookupBuilder->fetchColumnName($column);
        $newOrder = $lookupBuilder->buildJoin($this, $column);
        if (false === $newOrder) {
            return [$column, $direction];
        }

        list($alias, $column) = $newOrder;

        return [
            $alias.'.'.$column,
            $direction,
        ];
    }
1316772
public function loadOrderShippingMethod(
        CartInterface $cart,
        OrderInterface $order
    ) {
        $shippingMethodId = $cart->getShippingMethod();

        if (empty($shippingMethodId)) {
            return $this;
        }

        $shippingMethod = $this
            ->shippingWrapper
            ->getOneById($cart, $shippingMethodId);

        if ($shippingMethod instanceof ShippingMethod) {
            $order->setShippingAmount($shippingMethod->getPrice());
            $order->setShippingMethod($shippingMethod);
        }
    }
1113304
private function getNewMenuOrder(ItemInterface $menu): array
    {
        $menuOrder = array_keys($menu->getChildren());
        $configMenuIndex = array_search(MainMenuBuilder::ITEM_ADMIN, $menuOrder, true);
        if (is_int($configMenuIndex)) {
            array_splice($menuOrder, $configMenuIndex, 0, ['nglayouts']);

            return $menuOrder;
        }

        $menuOrder[] = 'nglayouts';

        return $menuOrder;
    }
129474
public function addOrderLine(OrderLineInterface $orderLine)
    {
        if (!$this->orderLines->contains($orderLine)) {
            $this->orderLines->add($orderLine);
        }

        return $this;
    }
440859
public function createApiLogsByOrderIds($orders)
    {
        $ids = [];
        /** @var \Orm\Zed\Sales\Persistence\SpySalesOrder $order */
        foreach ($orders as $order) {
            $ids[] = $order->getIdSalesOrder();
        }

        $query = $this->getFactory()->createPaymentPayoneApiLogQuery()
            ->useSpyPaymentPayoneQuery()
            ->filterByFkSalesOrder($ids, Criteria::IN)
            ->endUse()
            ->orderByCreatedAt();

        return $query;
    }
1037264
public function findByOrderId($orderId, $locale)
    {
        $result = array();
        $items = $this->getShippingRepository()->findByOrderId($orderId, $locale);
        foreach ($items as $item) {
            $result[] = $this->shippingFactory->createApiEntity($item, $locale);
        }
        return $result;
    }