Jump to content

Disable buy button after click


creation-handicap

Recommended Posts

Hello

I'm with Prestashop 1.7.2.2. I have the issue that I can click 2 times or more on the buy button in the checkout. Is there a way I can disable the button, after I clicked on it the first time?

When I click the button twice then there is a ugly white page appearing, with the message on it, that the shopping cart is already payed.

Link to comment
Share on other sites

I added this in /themes/core.js

$('body#checkout #payment-confirmation .btn-primary').prop('disabled',true);

Just before the form gets submitted. The form gets submitted on this line:

(0, _jquery2['default'])('#pay-with-' + option + '-form form').submit();

Just put my line before this one and the submit button gets disabled after one click.
It's a bit a hack, I know, but it works...

If there are better solutions, please post them here!

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...