Post by daneguero » Tue Sep 16, 2025 2:50 pm

Version 4.1.0.3

How to skip Thank You page and make it go directly to order details page after order is placed???

User avatar
Newbie

Posts

Joined
Thu Sep 11, 2025 5:43 pm

Post by khnaz35 » Tue Sep 16, 2025 3:40 pm

The best place to handle
catalog/controller/checkout/success.php

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Global Moderator

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by knowband.plugins » Wed Sep 17, 2025 4:19 pm

daneguero wrote:
Tue Sep 16, 2025 2:50 pm
Version 4.1.0.3

How to skip Thank You page and make it go directly to order details page after order is placed???
Modify catalog/controller/checkout/success.php

Replace.

Code: Select all

$this->response->setOutput($this->load->view('common/success', $data));
with

Code: Select all

if ($this->customer->isLogged()) {
            // If the customer is logged in, go to the order details page
            $this->response->redirect($this->url->link('account/order/info', 'order_id=' . $order_id, true));
} else {
            // If the customer is not logged in, remain on the same page. 
            $this->response->setOutput($this->load->view('common/success', $data));
} 
Also, on the top in the index function on the same file, define this.

Code: Select all

$order_id = $this->session->data['order_id'];

Regards,
Knowband Team

Opencart Plugins: Knowband Store
Email: support@knowband.com


User avatar
Active Member

Posts

Joined
Thu Aug 04, 2016 2:56 pm

Post by daneguero » Wed Sep 17, 2025 7:52 pm

knowband.plugins wrote:
Wed Sep 17, 2025 4:19 pm
daneguero wrote:
Tue Sep 16, 2025 2:50 pm
Version 4.1.0.3

How to skip Thank You page and make it go directly to order details page after order is placed???
Modify catalog/controller/checkout/success.php

Replace.

Code: Select all

$this->response->setOutput($this->load->view('common/success', $data));
with

Code: Select all

if ($this->customer->isLogged()) {
            // If the customer is logged in, go to the order details page
            $this->response->redirect($this->url->link('account/order/info', 'order_id=' . $order_id, true));
} else {
            // If the customer is not logged in, remain on the same page. 
            $this->response->setOutput($this->load->view('common/success', $data));
} 
Also, on the top in the index function on the same file, define this.

Code: Select all

$order_id = $this->session->data['order_id'];
Tried it. Doesn't work correctly.

But it says:
The page you requested cannot be found!
The page you requested cannot be found.


And url is like: /?route=account/order/info&order_id=51

User avatar
Newbie

Posts

Joined
Thu Sep 11, 2025 5:43 pm

Post by khnaz35 » Wed Sep 17, 2025 7:59 pm

You can try to log your flow and see where it is breaking.

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Global Moderator

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by JNeuhoff » Wed Sep 17, 2025 8:30 pm

This appears to be another bug in OC 4.1.0.3. Just tested it, neither /index.php?route=account/order/info&order_id=nn nor /en-gb? nor /en-gb?route=account/order/info&order_id=nn works (where nn is the numeric order id). You may try /en-gb?route=account/order/info&order_id=nn&customer_token=xxxx , get the customer_token from the session.

Anyway, several users have now advised you to use a stable OpenCart release, e.g. 3.0.4.1, instead of OpenCart 4 which is still subject to development and bugfixes.

Or you could post a request on the commercial support section of this forum, to find a developer who can do it as a paid job. The change would probably have to be implemented as an event handler for e.g. the trigger 'view/common/success/after'.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 10 guests