Post by nbrofree » Sun Jun 06, 2021 9:17 pm

On the page order success page "catalog/controller/checkout/success.php", there is a check to get the order_id:

Code: Select all

if (isset($this->session->data['order_id'])) {
However when the customer pays with Paypal standard, the order_id is not set, so I can not get other information like "$this->model_account_order->getOrderProducts($order_id)". The other payment methods work fine and the order_id is set.

In my understanding, the Paypal method unsets and clears the order before the success page. Anyone faced a similar problem? Can I keep the "data['order_id']" until success page and clear everything afterwards?

Newbie

Posts

Joined
Thu Mar 04, 2021 12:23 am

Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by nbrofree » Mon Jun 07, 2021 7:56 pm

Thank you for your reply, but unfortunately that did not help much. It is a twig file which is probably for Opencart 3. However I found the difference in an input value and tried it, but still no order_id.

Newbie

Posts

Joined
Thu Mar 04, 2021 12:23 am

Post by ADD Creative » Mon Jun 07, 2021 8:34 pm

What version of OpenCart?

For 2.3.02 it would be here that needs changing to the following.
https://github.com/opencart/opencart/bl ... rd.tpl#L38

Code: Select all

<input type="hidden" name="rm" value="1" />
Also check you are not using a poor theme that has it's own version of that file.

Use you web browser inspect tool at the last stage of checkout to see that the value is correct.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by nbrofree » Tue Jun 08, 2021 2:13 am

ADD Creative wrote:
Mon Jun 07, 2021 8:34 pm
For 2.3.02 it would be here that needs changing to the following.
Yes I have 2.3.0.2 and that is exactly what I changed.
ADD Creative wrote:
Mon Jun 07, 2021 8:34 pm
Also check you are not using a poor theme that has it's own version of that file.

Use you web browser inspect tool at the last stage of checkout to see that the value is correct.
You are right, I should check the theme in the first place but I can not find anything.
I do an echo of the order_id to inform the customer which works fine on the other payment methods (COD, bank transfer, store pickup) but not if paid with Paypal.

Still huge thanx for your time!

Newbie

Posts

Joined
Thu Mar 04, 2021 12:23 am

Post by ADD Creative » Tue Jun 08, 2021 3:01 am

nbrofree wrote:
Tue Jun 08, 2021 2:13 am
You are right, I should check the theme in the first place but I can not find anything.
I do an echo of the order_id to inform the customer which works fine on the other payment methods (COD, bank transfer, store pickup) but not if paid with Paypal.

Still huge thanx for your time!
It should be there for PayPal as well. None of those other payment methods go via a third party website, so check your session cookies are not set to SameSite=Strict.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 63 guests