I've been monitoring this the last couple of weeks and there are two situations that cause the cart not to clear.
1. The customer pays at paypal by credit card and is never redirected back to the website success page at all. Why they are not redirect back to the success page I do not know.
2. The customer pays through their paypal account. When they finish the transaction through their paypal account it appears they DO get sent back to the website success page. However, customers that close the success page without logging out or clicking onto any other page on the website do not have their carts cleared.
These are the two situations where carts do not clear. This is obviously a bug, and the previous vqmod uploaded to this topic doesn't work for v1.5.5.1.
PayPal checkout is a highly used area of the cart. A problem like you described would either be a rare edge case in the core, the result of third-party modification, or a misunderstanding of some underlying issue. A developer could try to guess at this all day and never get anywhere but as the operator of your website you should attempt to either locate the source of the issue in the code yourself or hire a developer who can then contribute the solution back to the community, if applicable.
-Ryan
Surely this bit of code would be better off in ModelCheckoutOrder::Confirm?rph wrote:Did some digging. This is caused by the customer not hitting the continue button on the order success screen and could be considered a "bug" with OpenCart.
What's happening is the success controller is properly clearing out the cart data in the session. It's still in the customer database though in the cart column. OpenCart updates this info based on the current cart session but if the customer doesn't go to anther page on your website after completing the order (e.g. they close the browser) that database cart info won't be cleared out.
EDIT: Added a VQMod bug fix. This is only tested lightly on 1.5.4.1 and 1.5.1.3 so use with caution.
That way, even if the customer does not return to the site (a good number of payment methods allow this - i.e. no automatic redirection after payment) then the cart will get cleared anyway.
Code: Select all
if ($order_info['customer_id']) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '' WHERE customer_id = '" . (int)$order_info['customer_id' . "'");
}
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
but it only happens when using Pay Pal Pro.
the Transaction completes on Paypal, the Database gets updated with the transactions info, but the screen never goes to success. leaving the confirm button still there and if pressed again it will repeat the order.
I tried your fix, it did not help this.
I'm no 1.5.5.1 but I started getting this problem on 1.4.x.x
I upgraded to try and fix it. Strange too how this seemed to just start acting up.
Code: Select all
if ($order_info['customer_id']) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '' WHERE customer_id = '" . (int)$order_info['customer_id' . "'");
}
Code: Select all
if (!empty($order_info['customer_id'])) {
$this->db->query("UPDATE `" . DB_PREFIX . "customer` SET `cart` = '' WHERE `customer_id` = '" . (int)$order_info['customer_id'] . "'");
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
https://www.paypal.com/us/cgi-bin/merch ... d=_account
And put that in the auto return. Problem fixed. User doesn't have to click anything.
I just finally narrowed it down to PP last night before finding this thread, and other fixes that didn't work.
Customer checks out at Paypal, and returns to site via link or auto-return = Cart cleared.
Customer checks out at Paypal, but closes browser after payment without returning = Cart not cleared.
IPN works to update order status and history, but does nothing for clearing the cart.
I found a site with a possible fix, but I haven't gotten it to work.
http://www.simonbattersby.com/blog/2013 ... ent-134699
If anyone gets a fix working and can explain it to us laymen (or post a VQmod) it would be greatly appreciated.
Use it? Like it? Want to support it but don't know how? Send a donation to show your appreciation.
Daniel's PayPal address - donate@opencart.com
Qphoria's Paypal address - qphoria@gmail.com
You need to set your paypal account to "Auto-Return" instead of sitting on the paypal receipt page.mwd wrote:Having the same issue with Paypal standard.
I just finally narrowed it down to PP last night before finding this thread, and other fixes that didn't work.
Customer checks out at Paypal, and returns to site via link or auto-return = Cart cleared.
Customer checks out at Paypal, but closes browser after payment without returning = Cart not cleared.
IPN works to update order status and history, but does nothing for clearing the cart.
I found a site with a possible fix, but I haven't gotten it to work.
http://www.simonbattersby.com/blog/2013 ... ent-134699
If anyone gets a fix working and can explain it to us laymen (or post a VQmod) it would be greatly appreciated.
Hi Q, Thanks for taking a look.Qphoria wrote:You need to set your paypal account to "Auto-Return" instead of sitting on the paypal receipt page.
Auto-Return is already set to On, as is Payment Data Transfer.
The problem is that Paypal isn't immediately sending a customer back after hitting pay.
Instead they get an Auto-Return page that redirects them to the cart automatically after 10 seconds.
If the customer closes the browser thinking they're finished before the 10 seconds expires and sends them back to the cart, the cart doesn't clear.
Is there some other setting I'm missing that will avoid this?
Something that immediately sends them back without hitting that auto-return page first?
Use it? Like it? Want to support it but don't know how? Send a donation to show your appreciation.
Daniel's PayPal address - donate@opencart.com
Qphoria's Paypal address - qphoria@gmail.com
Use it? Like it? Want to support it but don't know how? Send a donation to show your appreciation.
Daniel's PayPal address - donate@opencart.com
Qphoria's Paypal address - qphoria@gmail.com
PDT isn't used but that wouldn't help you anyway in this case.mwd wrote:Hi Q, Thanks for taking a look.Qphoria wrote:You need to set your paypal account to "Auto-Return" instead of sitting on the paypal receipt page.
Auto-Return is already set to On, as is Payment Data Transfer.
The problem is that Paypal isn't immediately sending a customer back after hitting pay.
Instead they get an Auto-Return page that redirects them to the cart automatically after 10 seconds.
If the customer closes the browser thinking they're finished before the 10 seconds expires and sends them back to the cart, the cart doesn't clear.
Is there some other setting I'm missing that will avoid this?
Something that immediately sends them back without hitting that auto-return page first?
It is true, if they close their browser in the 10 sec window, then they will still have item in their cart. This is pretty much the case with most carts I believe... but i think the odds are slim that people will close before the redirect ... but perhaps it happens more often than I think. It may be possible to link the cart clear step to the ipn as a backup
That was my thought as well, and would be a nice VQmod I'd be willing to pay for if someone can figure out how to make it.Qphoria wrote:It may be possible to link the cart clear step to the ipn as a backup

Use it? Like it? Want to support it but don't know how? Send a donation to show your appreciation.
Daniel's PayPal address - donate@opencart.com
Qphoria's Paypal address - qphoria@gmail.com
1. EDIT: catalog/model/checkout/order.php
2. FIND (TWICE):
Code: Select all
$this->db->query("UPDATE `" . DB_PREFIX . "order` SET order_status_id
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '' WHERE customer_id = '" . (int)$order_info['customer_id'] . "'");
I gave it a try without success, but we're in the middle of a server move from that whole EIG mess, so I can't be sure of where data is getting sent yet until all the DNS entries have updated.
I placed a few test orders using Paypal, and only one actually showed up in OC.
Once I'm sure everything is functioning correctly on the new server I'll give it a good testing.
Use it? Like it? Want to support it but don't know how? Send a donation to show your appreciation.
Daniel's PayPal address - donate@opencart.com
Qphoria's Paypal address - qphoria@gmail.com
hmm they should all show up in OC... the fix I made is for auto-clearing the cart if you close the window before being sent back to the success page. Best way to test:mwd wrote:Hi Q,
I gave it a try without success, but we're in the middle of a server move from that whole EIG mess, so I can't be sure of where data is getting sent yet until all the DNS entries have updated.
I placed a few test orders using Paypal, and only one actually showed up in OC.
Once I'm sure everything is functioning correctly on the new server I'll give it a good testing.
1. Login as a registered user
2. Add something to your cart
3. checkout with paypal
4. During the 5 sec auto-return countdown, close your browser
5. Open a new browser and log in with your account
6. See if the item is still in your cart
Users browsing this forum: No registered users and 68 guests