5 comments on “Adding Order ID to Checkout Success in OpenCart

  1. Hi Admin,

    Thank you so much. I tried it’s working.
    I need your help for showing Total Amount,
    I want to show total amount on that page also. I tried following code but total amount not showing.

    if (isset($this->session->data[‘order_id’])) {
    $data[‘orderDetails’] = $this->model_checkout_order->getOrder($this->session->data[‘order_id’]);
    $data[‘orderAmount’] = $this->cart->getTotal($this->session->data[‘total’]);

    • Kinda just grasping at straws here but I think you would want to stick with orderDetails instead of changing it to orderAmount. Just change order_id to order_total

      $data[‘orderDetails’] = $this->model_checkout_order->getOrder($this->session->data[‘order_total’]);

      Then you would make is show up by adding
      < ?php echo $orderDetails['order_total']; ?>

    • I just approved and responded to an older comment. Check it out. It may help but I’m not really an expert on this and usually just keep trying things until one works.

      The order status would always be the same wouldn’t it? That could just be static text.

  2. Hi Ben,
    Thank you for your solution to this problem, i spent more than 2 day searching for this problem
    I am not a programer just few coding, i found this page by google
    Now opencart 3 use twig instead of tpl
    i made a change a simple change to your code

    Change :


    {% if orderDetails[‘order_id’] is not empty %}
    {% endif %}

    My participation was to thank you and also to those who will come looking for this solution for those who do not have programming experience

Leave a Reply

Your email address will not be published. Required fields are marked *