public function testSelectObjectAction()
 {
     $orderId = 2082;
     $order = CoreShopOrder::getById($orderId);
     var_dump($order->getOrderState());
     exit;
 }
Ejemplo n.º 2
0
 /**
  * Process OrderState for Order
  *
  * @param CoreShopOrder $order
  * @param null $locale
  * @return bool
  * @throws \Exception
  */
 public function processStep(CoreShopOrder $order, $locale = null)
 {
     $emailDocument = $this->getEmailDocument($locale);
     $emailParameters = array("order" => $order, "newOrderStatus" => $this, "user" => $order->getCustomer());
     if ($this->getAccepted()) {
     }
     if ($this->getShipped()) {
     }
     if ($this->getPaid()) {
         Plugin::actionHook("paymentConfirmation", array("order" => $order));
     }
     Plugin::actionHook("orderStatusUpdate", array("newOrderStatus" => $this, "order" => $order));
     if ($this->getEmail() && $emailDocument instanceof Document\Email) {
         $mail = new Mail();
         $mail->setDocument($emailDocument);
         $mail->setParams($emailParameters);
         $mail->addTo($order->getCustomer()->getEmail(), $order->getCustomer()->getFirstname() . " " . $order->getCustomer()->getLastname());
         Tool::addAdminToMail($mail);
         $mail->send();
     }
     $order->setOrderState($this);
     $order->save();
     return true;
     //TODO: Stock Management
 }
Ejemplo n.º 3
0
 public function confirmationAction()
 {
     $orderId = $this->getParam("order");
     if ($orderId) {
         $order = \Pimcore\Model\Object\CoreShopOrder::getById($orderId);
         if ($order instanceof \CoreShop\Model\Order) {
             $this->session->order = $order;
         }
     }
     parent::confirmationAction();
 }
 public function thankyouAction()
 {
     if (!$this->session->user instanceof CoreShopUser) {
         $this->_redirect($this->view->url(array("action" => "index"), "coreshop_checkout"));
         exit;
     }
     $this->view->order = CoreShopOrder::getById($this->session->orderId);
     if (!$this->view->order instanceof CoreShopOrder) {
         $this->_redirect("/" . $this->language . "/shop");
     }
     $this->cart->delete();
     $this->prepareCart();
     unset($this->session->order);
     unset($this->session->cart);
     $this->view->headTitle($this->view->translate("Thank you"));
 }