PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Urgent Help Voucher Code Registration

Common Questions/Problems/Tips. Posted by Administrators & Support Reps.

Urgent Help Voucher Code Registration

Postby HD1512 » December 3rd, 2011, 8:26 am

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!
User avatar
HD1512
Registered User
Registered User
 
Posts: 10
Joined: October 26, 2011

Re: Urgent Help Voucher Code Registration

Postby Cristián Lávaque » December 4th, 2011, 2:18 am

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?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Urgent Help Voucher Code Registration

Postby demo38 » January 20th, 2012, 4:35 pm

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
User avatar
demo38
Registered User
Registered User
 
Posts: 5
Joined: January 16, 2012

Re: Urgent Help Voucher Code Registration

Postby HD1512 » January 22nd, 2012, 8:27 am

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!
User avatar
HD1512
Registered User
Registered User
 
Posts: 10
Joined: October 26, 2011

Re: Urgent Help Voucher Code Registration

Postby Cristián Lávaque » January 22nd, 2012, 5:43 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Urgent Help Voucher Code Registration

Postby demo38 » January 23rd, 2012, 10:59 am

Hi Christian,
THANK you for your help, that works beautifully. Very clean and slick solution.

Best,
Jonathon
User avatar
demo38
Registered User
Registered User
 
Posts: 5
Joined: January 16, 2012

Re: Urgent Help Voucher Code Registration

Postby Cristián Lávaque » January 27th, 2012, 4:59 am

Great! Glad I could help you. Thanks for reporting back. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to Common Questions/Problems/Tips

Who is online

Users browsing this forum: No registered users and 2 guests

cron