Jump to content

Multiple submit on customer registration - Major issue !


CH Ménival

Recommended Posts

Hi !

I've been using and integrating Prestashop for a few years now.

I was experiencing a major issue with customer registration. New customers would be registred without being set to a customer's group, making it impossible to order or even log in.

I've been looking for a solution for a few months now. I don't think the issue has been reported.

What I just found is : this happens when the registration form is submitted more than once, by clicking twice on the submit button, or enter key. This can be easily reproduced, even on latest versions of prestashop : just submit twice the ajax registration form and submission will fail (see snapshot from the demo shop). In my case the registration is not completed because the customer is not in a group. On the demo shop, the customer is fully registred. I think it's because the ajax submission on my shop is very slow and the double submission makes it fail before completion.

The solution is probably to prevent mutliple ajax submission of the form https://stackoverflow.com/questions/926816/how-to-prevent-form-from-submitting-multiple-times-from-client-side

I think this issue requires attention since it generates many usage issues and conversion loss, especially when ajax is slow, making the user more likely to submit multiple times.

Now, could someone please : 

1. Suggest the best fix to this ? I'm thinking of extending the js-script responsible for customer registration... Any ideas ?

2. Suggest how to improve performance on ajax user-registration form. For my shop, it takes about 10 to 13 seconds which is... very slow !

Thanks in advance !

My version of Prestashop : 1.7.6.4

My shop URL : https://www.librairie-theatrale.com/

 

Capture d’écran 2022-09-17 à 11.48.54.png

Link to comment
Share on other sites

Hello again,

I've appended this code to a custom js file

$("body").on("submit", "form", function() {
    $(this).submit(function() {
        return false;
    });
    return true;
});

It prevents the registration form to be submitted twice on this page : https://www.librairie-theatrale.com/connexion?create_account=1

But for some reason, it won't work when creating an account during checkout, which still is in error (see snapshot).

Capture d’écran 2022-09-19 à 09.30.48.png

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