Implements hook "order.complete.page"
@param array $order
@param \gplcart\core\models\Order $order_model
@param \gplcart\core\controllers\frontend\Controller $controller
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();
        }
    }
304600
public function updateTrackCode(Model $order, UpdateTrackCodeRequest $request)
    {
        $order->update(['track_code' => $request->track_code]);

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

        return redirect()->route('admin.order.index');
    }
1265962
public static function getOrderForm($view_mode = 'full', $type = 'order') {
    $form = \Drupal::formBuilder()->getForm('Drupal\site_orders\Form\SiteOrdersForm', $view_mode, $type);
    $form['#action'] = '/order-successfully-issued';
    return $form;
  }
265780
protected function finishAddOrderCheckout(array $result)
    {
        if (!empty($result['order']['order_id'])) {

            $vars = array(
                '@num' => $result['order']['order_id'],
                '@name' => $result['order']['customer_name'],
                '@status' => $this->order->getStatusName($result['order']['status'])
            );

            $message = $this->text('Order #@num has been created for user @name. Order status: @status', $vars);
            $this->redirect("admin/sale/order/{$result['order']['order_id']}", $message, 'success');
        }
    }
1137802
public function run()
	{
		$context = $this->getContext();
		$controller = \Aimeos\Controller\Common\Order\Factory::create( $context );
		$baseManager = \Aimeos\MShop::create( $context, 'order/base' );
		$manager = \Aimeos\MShop::create( $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', 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', \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED ),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );

		$start = 0;

		do
		{
			$baseIds = [];
			$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() );
	}
969069
public static function orderRecords(array $records, $order)
    {

        if (!is_array($order))
        {
            $order = [ $order ];
        }

        $instructions = [ ];
        foreach ($order as $property)
        {
            $property  = trim($property);
            $sortorder = substr($property, -1);

            switch ($sortorder)
            {
                case '-';
                case '+':
                    $property = substr($property, 0, -1);
                    break;
                default:
                    $sortorder = '+';
                    break;

            }

            $instructions[] = [ 'property' => $property, 'order' => $sortorder ];

        }

        uasort($records, function (Record $a, Record $b) use ($instructions)
        {

            foreach ($instructions as $instruction)
            {
                $property = $instruction['property'];
                $order    = $instruction['order'];

                switch ($property)
                {
                    case '.id':
                        $valueA = $a->getId();
                        $valueB = $b->getId();
                        break;
                    case '.info.creation.username':
                        $valueA = $a->getCreationUserInfo()->getUsername();
                        $valueB = $b->getCreationUserInfo()->getUsername();
                        break;
                    case '.info.creation.firstname':
                        $valueA = $a->getCreationUserInfo()->getFirstname();
                        $valueB = $b->getCreationUserInfo()->getFirstname();
                        break;
                    case '.info.creation.lastname':
                        $valueA = $a->getCreationUserInfo()->getLastname();
                        $valueB = $b->getCreationUserInfo()->getLastname();
                        break;
                    case '.info.creation.timestamp':
                        $valueA = $a->getCreationUserInfo()->getTimestamp();
                        $valueB = $b->getCreationUserInfo()->getTimestamp();
                        break;
                    case '.info.lastchange.username':
                        $valueA = $a->getLastChangeUserInfo()->getUsername();
                        $valueB = $b->getLastChangeUserInfo()->getUsername();
                        break;
                    case '.info.lastchange.firstname':
                        $valueA = $a->getLastChangeUserInfo()->getFirstname();
                        $valueB = $b->getLastChangeUserInfo()->getFirstname();
                        break;
                    case '.info.lastchange.lastname':
                        $valueA = $a->getLastChangeUserInfo()->getLastname();
                        $valueB = $b->getLastChangeUserInfo()->getLastname();
                        break;
                    case '.info.lastchange.timestamp':
                        $valueA = $a->getLastChangeUserInfo()->getTimestamp();
                        $valueB = $b->getLastChangeUserInfo()->getTimestamp();
                        break;
                    default:
                        $valueA = $a->getProperty($property);
                        $valueB = $b->getProperty($property);
                        break;
                }

                if ($order == '+')
                {
                    if ($valueA < $valueB)
                    {
                        return -1;
                    }
                    if ($valueA > $valueB)
                    {
                        return 1;
                    }
                }
                else
                {
                    if ($valueA > $valueB)
                    {
                        return -1;
                    }
                    if ($valueA < $valueB)
                    {
                        return 1;
                    }
                }

            }

        });

        return $records;
    }
1079018
public function mark_ready_for_dispatchAction(Order $order)
    {
        $order->markReadyForDispatchBySeller();

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
1042846
public function orderBy($order = null) {
		if (is_null($order)) //remove option
			return $this->discard('query.orderBy');
			
		return $this->merge(['query.orderBy' => func_get_args()]);
	}
249699
protected function createItemBagForOrder(Order $order)
    {
        if (!$this->sendCartInfo) {
            return null;
        }

        $items = $this->getItemListForOrder($order);
        $itemBagClassName = $this->getItemBagClassName();

        return new $itemBagClassName($items);
    }
1184190
public function editStatus(Model $order)
    {
        $orderStatus = OrderStatus::all()->pluck('name', 'id');

        $view = view('avored-framework::order.view')
            ->with('order', $order)
            ->with('orderStatus', $orderStatus)
            ->with('changeStatus', true);

        return $view;
    }
582422
public function process()
	{
		$view = $this->getView();

		if( $view->param( 'cs-order', null ) === null ) {
			return;
		}

		try
		{
			$controller = Controller_Frontend_Factory::createController( $this->_getContext(), 'basket' );
			$controller->get()->check( MShop_Order_Item_Base_Abstract::PARTS_ALL );

			parent::process();
		}
		catch( Exception $e )
		{
			$view->standardStepActive = 'summary';
			throw $e;
		}
	}
636856
public function sendOrder(Request $request, $order_id)
    {
        $elementIds = $request->request->get('elements', []);
        $acceptor = $this->getAuthenticatedUser();

        $basketElements = $this->doAcceptElements($order_id, $elementIds, $acceptor);

        $success = !empty($basketElements);

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success'  => $success,
                'msg'      => $success
                    ? $this->app->trans('Order has been sent')
                    : $this->app->trans('An error occured while sending, please retry  or contact an admin if problem persists'),
                'order_id' => $order_id,
            ]);
        }

        return $this->app->redirectPath('prod_orders', [
            'success' => (int) $success,
            'action'  => 'send',
        ]);
    }
201826
public function orderBy($sort, $order = null)
    {
        return $this->add('orderBy', $sort . ' ' . (! $order ? 'ASC' : $order), false);
    }
1025272
protected function prepareOrderCheckoutComplete(array &$order)
    {
        $this->setItemTotalFormatted($order, $this->price);
        $this->setItemTotalFormattedNumber($order, $this->price);
    }
560743
public function eventOrderUpdate($order_id)
    {
        $source = $this->container->getSource(Source::Order, $order_id);
        $this->container->getInvoiceManager()->sourceStatusChange($source);
    }
543538
public function receiveAction(Order $order)
    {
        $order->receiveByHub();

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
982751
public function orderCartClear(/** @noinspection PhpUnusedParameterInspection */ OrderEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        // Empty cart and clear current order
        $session = $this->getSession();

        $session->clearSessionCart($dispatcher);

        $session->setOrder(new OrderModel());
    }