One other thing… In the knowledge base, one of the options includes:
“Create a custom HTML form that accepts a voucher/coupon code and then write custom PHP code to check the code against a known-list of codes, only providing access to the form if the code is valid.”
Can we get some further instruction on how to go about this?
The idea here would be to create an HTML form like this:
<form method="post" action="">
Your Coupon Code: <input type="text" name="s2m_coupon_show" />
</form>
Then, to verify that it’s the right code, you’d do something like this:
<?php if(!empty(($coupon = $_POST['s2m_coupon_show'])) && is_correct_code($coupon) /* NOTE: The is_correct_code() function isn't something s2Member has set up, you'll need to do this. */) { ?>
This is where your unlocked signup would go.
<?php } else { ?>
This is the form for inputting a custom coupon code, outside of s2Member.
<form method="post" action="">
Your Coupon Code: <input type="text" name="s2m_coupon_show" />
<input type="submit" value="Submit " />
</form>
Your normal signup shortcode / anything that the user should see before they've put in a coupon above.
<?php } ?>
Thank you for your response. If I were to modify the registration form. Would I use the Authorize.net form since that is what we are using for the paid registrations? If so, where is the php that calls up the coupon codes from S2?
Yes, If you’re using Authorize.net, the correct file to alter would be /s2member-pro/includes/templates/authnet-registration-form.php