Jump to content

$errormessage}, If user already exist in database then add him again ?


Recommended Posts

Hello, i am designing my website in a way that i want to process if the user is already exist in database at checkout form then create a dummy user with random email and address so the user can process the payment because in my case i can define that user,

let me explain

normaly the user at checkout enter his email and full name & pass etc.. , what i want to do is when the $errormessage get fired about existing email i want that user to complete to order confirmation page  nomatter what, if that is not possible.
i want then to generate a dummy email to replace the existing email so he can process to order confirmation page.

What i have so far to generate the ddummy data is this using javascript to get dummy data from an API:

    //Get API
    fetch('https://randomuser.me/api/?results=100')
        .then(res => res.json())
        .then(data => {
            let author = data.results;
            author.forEach(function (lists) {
                document.getElementById('inputEmail').value = lists.login.username+="@gmail.com";
            });
        });

 

i hope i was clear explaining my situation.

thank you very much .

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated