opencart order change status 1

opencart order change status

$status_order = $this->checkOrder($this->request->get['order_id']);
        $id = $this->request->get['id'];
        $this->load->model('checkout/order');
        if ($status_order) {
            $this->model_checkout_order->addOrderHistory($id, 5);
            $this->response->redirect($this->url->link('akbarali/intend/success', '', 'SSL'));
        } else {
            $this->model_checkout_order->addOrderHistory($id, 7);
            $this->response->redirect($this->url->link('akbarali/intend/error', '', 'SSL'));
        }

Here is what the above code is Doing:
1. It’s checking if the order is valid or not.
2. If the order is valid, it’s updating the order status to 5 (Processing) and redirecting to the success page.
3. If the order is not valid, it’s updating the order status to 7 (Failed) and redirecting to the error page.

Similar Posts