Page 1 of 1

Urgent Help Voucher Code Registration

PostPosted: December 3rd, 2011, 8:26 am
by HD1512
Hi all,

I need to accept voucher codes that will enable a free registration. The user will have paid elsewhere for the voucher code. I've seen the video about free registration with voucher codes and using a database of codes. But I just want 1 code.

I've also seen in previous posts you can't do this with coupon codes because the lowest they will accept is $0.01.

Can i do this? I think I need a separate registration form not linked to paypal with a required filled that will only work with the correct voucher code.

Please help!

Re: Urgent Help Voucher Code Registration

PostPosted: December 4th, 2011, 2:18 am
by Cristián Lávaque
Hmm... well, You could have the voucher in the URL like http://yoursite.com/?voucher=free and then in your page use PHP conditional to check for it. If it's there, show a free registration page, else the regular payment form.

Code: Select all
<?php if (isset($_GET['voucher']) && $_GET['voucher'] == 'free') { ?>
Show the free registration form.
<?php } else { ?>
Show the payment form.
<?php } ?>


Would that work for you?

Re: Urgent Help Voucher Code Registration

PostPosted: January 20th, 2012, 4:35 pm
by demo38
Hi Christian,
This sounds close to what I need. I've installed the PHP Execution plugin (mentioned in API/Scripting) and tried using the conditional you posted above inside of a Free Registration Page, but I get:

Code: Select all
Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ‘,’ or ‘)’ in /home/pitch/public_html/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()’d code on line 1


I need to find a way to allow for a custom link or coupon code for 12 months free registration, but need to limit it to only a few people.

Thanks for your help,
J

Re: Urgent Help Voucher Code Registration

PostPosted: January 22nd, 2012, 8:27 am
by HD1512
Hi J,

I ended up just using a free registration form set to S2 Member Level 1 and inserted a voucher code field into the registration form. But it wasn't set to check against any database. I just didn't have the time to hire someone nor did I know enough PHP coding myself. It's not a long term fix by any means but it worked for what I was after and of course you can check that the right code has been entered anyway once someone has signed up.

The other option you could use is to password protect the free registration page straight through Wordpress (this option is just below the Publish Page option on the right hand side when you are editing a page). You can then make the voucher code the page password.

Not the most stylish options but they work!

Re: Urgent Help Voucher Code Registration

PostPosted: January 22nd, 2012, 5:43 pm
by Cristián Lávaque
demo38 wrote:Hi Christian,
This sounds close to what I need. I've installed the PHP Execution plugin (mentioned in API/Scripting) and tried using the conditional you posted above inside of a Free Registration Page, but I get:

Code: Select all
Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ‘,’ or ‘)’ in /home/pitch/public_html/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()’d code on line 1


I had a syntax error in the condition, I'm very sorry. I edited my previous post to fix it.

Re: Urgent Help Voucher Code Registration

PostPosted: January 23rd, 2012, 10:59 am
by demo38
Hi Christian,
THANK you for your help, that works beautifully. Very clean and slick solution.

Best,
Jonathon

Re: Urgent Help Voucher Code Registration

PostPosted: January 27th, 2012, 4:59 am
by Cristián Lávaque
Great! Glad I could help you. Thanks for reporting back. :)