WPPayForm Auto User Register

This is a code snippet which registers a user after a successful payment. If the user is already logged in when the payment is made, it will just skip the this process.

A random password will be generated and the new user will be automatically logged in. The code executes using the ‘wppayform/form_payment_success’ hook, this executes when payment is successfully completed.

You need to add this following code in your theme function.php file by going to Appearance > Theme Editor .

https://gist.github.com/techjewel/b53056a8aef933acf282f050d09e69fd

This code will run for every Wp Pay form. If you use the following lines with your required form ID (instead of 100 ) it will only run for that Wp Pay form only.

   if($formId != 100) {
return;
}

Was this article helpful to you?

4

How can we help?

Please submit a support ticket if you have any question or pre-sale questions. Our Customer support engineers will answer your query as soon as possible

Open a support ticket