context->cart; if (true === (bool)Tools::getValue('free_order')) { $this->checkFreeOrder(); $this->id_cart = (int)$this->context->cart->id; $this->id_order = Order::getIdByCartId((int)($this->id_cart)); $this->secure_key = Tools::getValue('key', false); $order = new Order((int)($this->id_order)); $this->reference = $order->reference; $freeorderconfirmation = Module::getInstanceByName('freeorderconfirmation'); $redirectLink = $freeorderconfirmation::getOrderConfirmationPage($this->id_order); if ($redirectLink != false) { Tools::redirect($redirectLink); } $this->order_presenter = new OrderPresenter(); } elseif (Tools::getValue('id_order', 'false') != 'false') { $this->id_order = Tools::getValue('id_order'); $order = new Order($this->id_order); $this->id_cart = (int)$order->id_cart; $this->order = $order; $this->customer = $this->context->customer; if ($this->context->customer->id == $this->order->id_customer) { $this->order_presenter = new OrderPresenter(); } else { parent::init(); } } else { parent::init(); } } else { parent::init(); } } }