/** * Create an order outside of the front-office context, e.g. manually from the back-office. */ public function createManual(OrderManualEvent $event) { $paymentModule = ModuleQuery::create()->findPk($event->getOrder()->getPaymentModuleId()); /** @var \Thelia\Module\PaymentModuleInterface $paymentModuleInstance */ $paymentModuleInstance = $paymentModule->createInstance(); $event->setPlacedOrder($this->createOrder($event->getDispatcher(), $event->getOrder(), $event->getCurrency(), $event->getLang(), $event->getCart(), $event->getCustomer(), $paymentModuleInstance->manageStockOnCreation())); $event->setOrder(new OrderModel()); }
/** * Create an order outside of the front-office context, e.g. manually from the back-office. */ public function createManual(OrderManualEvent $event) { $event->setPlacedOrder($this->createOrder($event->getDispatcher(), $event->getOrder(), $event->getCurrency(), $event->getLang(), $event->getCart(), $event->getCustomer())); $event->setOrder(new \Thelia\Model\Order()); }