Set up order complete page
@param array $order
@param \gplcart\core\models\Order $model
@param \gplcart\core\controllers\frontend\Controller $controller
554857
protected function setCompletePage(array $order, $model, $controller)
    {
        if ($order['payment'] === 'stripe') {

            $this->order = $model;
            $this->data_order = $order;
            $this->controller = $controller;

            $this->submitPayment();

            $controller->setJs('https://js.stripe.com/v2');
            $controller->setJs('system/modules/stripe/js/common.js');
            $controller->setJsSettings('stripe', array('key' => $this->getPublicKey()));
        }
    }
829799
public function setOrder(\Sulu\Bundle\Sales\OrderBundle\Entity\Order $order = null)
    {
        $this->order = $order;
    
        return $this;
    }
245605
public function run()
	{
		$context = $this->_getContext();
		$controller = Controller_Common_Order_Factory::createController( $context );
		$baseManager = MShop_Factory::createManager( $context, 'order/base' );
		$manager = MShop_Factory::createManager( $context, 'order' );

		/** controller/jobs/order/cleanup/unfinished/keep-hours
		 * Release the ordered products after the configured time if no payment was confirmed
		 *
		 * After a customer creates an order and before he is redirected to the
		 * payment provider (if necessary), the ordered products, coupon codes,
		 * etc. are blocked for that customer. Normally, they should be released
		 * a certain amount of time if no payment confirmation arrives so
		 * customers can order the products and use the coupon codes again.
		 *
		 * The configured number of hours should be high enough to avoid releasing
		 * products and coupon codes in case of temporary technical problems!
		 *
		 * The unfinished orders are deleted afterwards to keep the database clean.
		 *
		 * @param integer Number of hours
		 * @since 2014.07
		 * @category User
		 */
		$hours = $context->getConfig()->get( 'controller/jobs/order/cleanup/unfinished/keep-hours', 7 * 24 );
		$limit = date( 'Y-m-d H:i:s', time() - 3600 * $hours );

		$search = $manager->createSearch();
		$expr = array(
			$search->compare( '<', 'order.mtime', $limit ),
			$search->compare( '==', 'order.statuspayment', MShop_Order_Item_Abstract::PAY_UNFINISHED ),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );

		$start = 0;

		do
		{
			$baseIds = array();
			$items = $manager->searchItems( $search );

			foreach( $items as $item )
			{
				$controller->unblock( $item );
				$baseIds[] = $item->getBaseId();
			}

			$baseManager->deleteItems( $baseIds );

			$count = count( $items );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count >= $search->getSliceSize() );
	}
196426
public function updateStatus(Model $order, UpdateOrderStatusRequest $request)
    {
        //$order = Model::find($id);
        $order->update($request->all());

        $userEmail = $order->user->email;
        $orderStatusTitle = $order->orderStatus->name;

        $orderHistoryRepository = app(OrderHistoryInterface::class);
        $orderHistoryRepository->create(['order_id' => $order->id, 'order_status_id' => $request->get('order_status_id')]);

        Mail::to($userEmail)->send(new UpdateOrderStatusMail($orderStatusTitle));

        return redirect()->route('admin.order.index');
    }
509144
final public function orderBy(string $orderBy, string $order = 'ASC')
    {        
       $this->query->addOrderBy($orderBy, $order);

        return $this;
    }
375605
public function setItemOrderAddress(&$order, $address_model)
    {
        $order['address'] = array();

        foreach (array('shipping', 'payment') as $type) {
            $address = $address_model->get($order["{$type}_address"]);
            if (!empty($address)) {
                $order['address'][$type] = $address;
                $order['address_translated'][$type] = $address_model->getTranslated($order['address'][$type], true);
            }
        }
    }
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'));
    }
729583
public function addOrder(Order $order)
    {
        if (count($this->orders)+1 >= self::MAX_NUM_ORDERS)
        {
            throw new Exception('Cannot have more than '.self::MAX_NUM_ORDERS.' Orders in a single Order Collection');
        }

        $this->orders[] = $order;
        $order->setCollection($this);
    }
532639
public function setOrder($mode, $direction = self::DIRECTION_ASC)
    {
        $this->orderMode = $mode;
        $this->orderDirection = $direction;
    }
425493
public function hookOrderCompletePage(array $order, $order_model, $controller)
    {
        if ($order['payment'] === 'authorize_sim') {

            $this->data_order = $order;
            $this->order = $order_model;
            $this->controller = $controller;

            $this->processPurchase();
        }
    }
702313
protected function _setLayout(Controller &$controller) {
		if ($controller->name == 'CakeError') {
			$controller->layout = 'CakeTheme.error';

			return;
		}

		$isAjax = $controller->request->is('ajax');
		$isPjax = $controller->request->is('pjax');
		$isHtml = $this->_controller->ViewExtension->isHtml();
		if ($isPjax) {
			$controller->layout = 'CakeTheme.pjax';
		} elseif ($isHtml && !$isAjax) {
			if ($controller->request->param('controller') === 'users') {
				$controller->layout = 'CakeTheme.login';
			} else {
				if ($controller->layout === 'default') {
					$controller->layout = 'CakeTheme.main';
				}
			}
		}
	}
478780
public function setOrder(\Librinfo\EcommerceBundle\Entity\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
136485
protected function setOrder($order_id)
    {
        $this->data_order = array();

        if (is_numeric($order_id)) {

            $this->data_order = $this->order->get($order_id);

            if (empty($this->data_order)) {
                $this->outputHttpStatus(404);
            }

            $this->order_history->setViewed($this->data_order);
            $this->prepareOrder($this->data_order);
        }
    }
529530
public function setOrders($orders)
    {
        foreach ($orders as $order) {
            $this->orders[$order->id] = $order->expose();
        }
    }
500917
public function setOrder(\HarvestCloud\CoreBundle\Entity\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
1250855
public function order($order)
    {
        $order = $this->prepareNames(func_get_args(),false);
        $this->order = $order;
        return $this;
    }
1001536
public function setOrdersForSingleSync($orders)
    {
        foreach ($orders as $order) {
            $this->ordersForSingleSync[$order->id] = $order->expose();
        }
    }