Jump to content

[Solved] Ajax cart posting wrong total when item removed


Recommended Posts

Hello,

 

on my PS 1.4.6.2 installation, when the last thing a customer does before hitting the "checkout" button is to remove an item, the displayed total is updated, but the cart still forwards the old total to the credit card processor Worldpay.

 

So the customer thinks we are trying to rip him off if he notices, or if he doesn't and does pay the wrong amount, he still gets a payment error.

 

It looks like the cart does not refresh all hidden values when the customer removes an item, but only if this is the last thing he does. If he does select a carrier o checks the terms and conditions after having removed the item, the cart updates corrects, but only then.

 

This bug is pretty bad when it comes to customer trust, authorizing a wrong amount on a card payment does not make our company look trustworthy.

 

So help on where to look for the error cause or how I could solve this would be much appreciated.

 

Thanks in advance!

 

Dan

 

Issue was fixed in Forge / bug tracker: PSCFI-4813

Link to comment
Share on other sites

Hi Carl,

 

it is a custom theme from the Prestastore (TNT2). I wanted to check on the default template, but I am already in production and have no test server to run it on.

 

I am running the theme with CCC enabled, but I am not sure it is 100% compatible (there are no visual errors). Could that be the cause?

 

Cordialement,

 

Daniel

Link to comment
Share on other sites

Hi Carl,

 

I did try with the standard default template included with PS 1.4.6.2, same issue - if you have a duplicate item and remove one, the cart info passed along to Worldpay is not updated.

 

The main problem is that on the one page checkout, if it is a registered customer doing the purchase, the terms and conditions box is already checked, as well as the shipping method - if the customer had to select one of these, the cart would refresh and the error would be gone. But many of our customers are already registered, so that fails.

Link to comment
Share on other sites

Hi Carl,

 

where are the settings for ajax cart mode? I will give it a try.

 

I did already look at the bug tracker before posting here, there was no similar bug, so I did create it here:

http://forge.prestashop.com/browse/PSCFI-4813

 

Our website was one of those infected with the her.php issue caused by the PS news in the BO last year, and while we applied all patches, but I am still a bit paranoid that this incident might have "damaged" part of our PS installation.

Link to comment
Share on other sites

UPDATE: I actually found where to change the ajax setting for the cart, and even with ajax turned off, the problem persists, the info is not updated correctly, and the wrong amount is sent to Worldpay.

 

Which makes me wonder, could this issue be related to the Worldpay module rather than PS itself? We have the official Prestastore Worldpay module, but there were quite a lot of tweaking and back and forth with the support team to actually get it to work.

 

So could that be the root of the problem?

Link to comment
Share on other sites

It is in modules, search for "cart" and then configure it.

 

You have the option to disable the ajax cart mode.

 

It is a good thing you created a report. It can take some time for a developper to take a look at it.

 

If you applied the patch, cleaned everything, there is a little risk your PS was damaged.

Link to comment
Share on other sites

Hi Carl,

 

it did happen out of the blue, we have not installed any new modules for months. The only thing we have been tinkering with is the .htaccess file, and we disabled the stats module.

 

I can't say for sure if this problem has always been there or was caused by something specific, because I think most customers don't remove items from the basket AFTER having checked the terms and conditions. Which is why we never noticed until recently, when we had two customers within 48 hours with this error, and did some tests. That's when we found out the amount is wrong when a customer removes items from the basket after checking terms and conditions.

 

It is very well possible that other customers had this issue too and simply abandoned cart when they saw a false amount on the Worldpay page, it's hard to say.

Link to comment
Share on other sites

Hi Carl,

 

thank you again for your help! I just wanted to let you know that Laurent Brieu was assigned to the bug report I opened in Forge, and that he made some changes that fixed the bug. So I can't post the solution here, but I will mark the thread as solved.

 

If I understood correctly, this bug is likely to affect all shops that use OPC if the customer checks the terms before making his last change to the basket, so I would assume that the fix will be ported to future versions of PS automatically. So it should not matter that the solution could not be posted here.

 

Again, a really big major thanks to the whole Presta team and the people who help on the forums. A great company, and a great community.

 

Un grand merci à toute l'équipe!

 

Cordialement,

 

Dan

Link to comment
Share on other sites

  • 11 months later...

Hi,

 

I come from Malaysia. I have the same problem like you, the ajax cart posting wrong total amount of money when item removed / increased. Would you mind to share the js files that you used for solving the problem?

 

Thank you in advanced :)

 

Note: I'm using Prestashop 1.5.3

Edited by YT Low (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...