Esempio n. 1
0
 /**
  * Get order
  *
  * @return \XLite\Model\Order
  */
 protected function getOrder()
 {
     if (null === $this->order) {
         $order = $this->getParam(static::PARAM_ORDER);
         // Get temporary order if exists otherwise get current order
         $this->order = \XLite\Controller\Admin\Order::getTemporaryOrder($order->getOrderId(), false) ?: $order;
     }
     return $this->order;
 }
Esempio n. 2
0
 /**
  * Get current order entity
  *
  * @return \XLite\Model\Order
  */
 protected function getOrderEntity()
 {
     $order = $this->getOrder();
     return \XLite\Controller\Admin\Order::getTemporaryOrder($order->getOrderId(), false) ?: $order;
 }
Esempio n. 3
0
 /**
  * Return model object to use: temporary
  *
  * @return \XLite\Model\Order
  */
 public function getModelObject()
 {
     $object = parent::getModelObject();
     if ('recalculate' === $this->currentAction) {
         // Get temporary order (force to create this)
         $object = \XLite\Controller\Admin\Order::getTemporaryOrder($object->getOrderId(), true);
     } else {
         // Get temporary order if exists otherwise get current object
         $object = \XLite\Controller\Admin\Order::getTemporaryOrder($object->getOrderId(), false) ?: $object;
     }
     return $object;
 }