latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

passing voucher code after free registration

Home Forums Community Forum passing voucher code after free registration

This topic contains 3 replies, has 2 voices. Last updated by  Raam Dev 4 years, 3 months ago.

Topic Author Topic
Posted: Tuesday Oct 2nd, 2012 at 7:41 pm #27277
TJ
Username: wellwater

There’s a knowledge base article that discusses how to implement gift certificate vouchers:
http://www.s2member.com/kb/offering-free-coupon-code/

The trouble I’m facing is how do I pass this voucher code forward after the free registration form is submitted? I need to intercept this unique value somehow so I can mark the voucher as “used” to prevent anyone else from using it after they register.

Thanks.

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Wednesday Oct 3rd, 2012 at 5:21 am #27312
Raam Dev
Username: Raam
Staff Member

The most simple method would be to use the success=”” attribute in your Pro-Form shortcode (see Dashboard -› s2Member® -› PayPal® Pro Forms -› Shortcode Attributes (Explained)) to redirect the registration form to a Thank You page.

In that URL, you’d include the voucher used, for example:

success="http://example.com/thank-you/?voucher=<?php echo $_GET['voucher']; ?>"

Then on the Thank You page you’d use some PHP to quietly read that value ($_GET[‘voucher’]) and mark it as used in your database.

When someone successfully accesses the Free Registration form, the success URL will contain the voucher code in the query string and when they successfully register and get redirected to the thank you page, the voucher code will be passed along.

Posted: Thursday Oct 4th, 2012 at 8:25 pm #27513
TJ
Username: wellwater

Hi Raam,

Thanks. I think that will work.

Posted: Friday Oct 5th, 2012 at 4:05 am #27542
Raam Dev
Username: Raam
Staff Member

Great! Let us know if you have any other questions.

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.