Post by pedro1993 » Thu Oct 01, 2015 7:05 pm

Hi everyone,

I am just doing some debugging on my clients OpenCart (1.5.6) website. Basically, the client said that when they complete an order the cart doesn't always clear. They are using the box-standard PayPal Standard payment method.

Whilst debugging I saw that the following file has this line of code:

Code: Select all

if (isset($this->session->data['order_id'])) {
I am confused to why this if condition is required as this is in the success.php page. Surely, when the success.php page is called, this would be an indicator that the order ID does exist as the order was successfully created, thus, this condition isn't needed (however the code within the condition is).

Just wondering what everyone elses thoughts are on this?

For OpenCart & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support


Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland

Post by sculptex » Fri Oct 02, 2015 12:54 am

it is often prudent to have checks for this sort of thing in case someone refreshes a page or clicks back on their browser etc. it can prevent duplicate orders or someone happening on the page by accident

ImageImage


User avatar
Active Member

Posts

Joined
Tue Sep 13, 2011 3:07 am
Location - UK

Post by Qphoria » Fri Oct 02, 2015 4:12 am

You can manually load the success page at anytime.. or you could refresh the success page which at that point would no longer have the order id since they are unset.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by pedro1993 » Fri Oct 02, 2015 8:55 pm

Qphoria wrote:You can manually load the success page at anytime.. or you could refresh the success page which at that point would no longer have the order id since they are unset.
I see! Thank you both for getting back.

I knew I was probably overlooking something!

For OpenCart & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support


Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland
Who is online

Users browsing this forum: Majestic-12 [Bot] and 299 guests