예제 #1
0
 protected function getEditionResponse(Entity $entity = null)
 {
     $response = parent::getEditionResponse($entity);
     // Add the status labels.
     $response->addData('orders', array('statuses' => Order::getStatusLabels()));
     return $response;
 }
예제 #2
0
파일: Order.php 프로젝트: eix/catalog
 public function issue()
 {
     // Load the statuses map into the response.
     $this->addData('orders', array('statuses' => OrderModel::getStatusLabels()));
     parent::issue();
 }
예제 #3
0
 private function getEndCheckoutResponse()
 {
     $customer = Customers::getCurrent();
     try {
         // Validate additional fields.
         $this->updateCustomerData();
         // Generate order
         $order = new Order(array('basket' => $customer->getBasket(), 'customer' => $customer, 'comments' => $this->getRequest()->getParameter('comments')));
         // Save the new order.
         $order->store();
         // Send a confirmation request e-mail.
         $order->sendConfirmationRequestMessage();
         // Get rid of the customer data.
         $customer->destroy();
         // View the order that has just been created.
         $response = new \Nohex\Eix\Core\Responses\Http\Redirection($this->getRequest());
         $response->setNextUrl("/comandes/{$order->id}");
     } catch (ValidationException $exception) {
         $response = $this->getHtmlResponse();
         $response->setTemplateId('basket/checkout');
         $response->addErrorMessage(array('validation' => $exception->getValidationStatus()));
     }
     // Add the customer data to the response.
     $response->addData('customer', $customer->getFieldsData());
     return $response;
 }