Jump to content
Mister Denial

[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

Share this post


Link to post
Share on other sites

I have tried disabling ajax search in case that would put too much strain on the server resources, but no use, the error persists. Both in Chrome and Firefox. Anyone got an idea? Thanks!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Yes you could try to disable CCC. But it would be also good (late hour maybe?) to check with the default theme if it is not fixed after that.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Hi Mister Denial,

 

You should take a look on the bug tracker about your issue and report it if you find no solution.

 

Have you also tried to disable ajax cart mode?

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Oups, I was too slow :).

 

Indeed, if after all this you still have the issue, the problem may be coming from the Worldpay module.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More