wpsharks / s2member-kb

The s2Member® and s2Member® Pro Knowledge Base
9 stars 4 forks source link

How can I offer a Free Registration with Access Code? #309

Open kristineds opened 8 years ago

kristineds commented 8 years ago

KB Article Creation Checklist
title: How can I offer a Free Registration with Access Code?
categories: Questions
tags: mu-plugins-hacks, tricks, giftredemption-codes, pro-forms, custom-capabilities
author: kristineds
github-issue: https://github.com/websharks/s2member-kb/issues/#
Additional TODOs

This is a work in progress.


I want people to get free access to my exclusive content (via promo code). I don't want to charge any fee, just allow people to enter their code and create an account.

You could set this up by generating a Paypal (Buy Now) Pro-Form and applying a coupon code that gives your customers 100% discount which will make it free and give them access to your exclusive content

Generate Pro-Form Coupon Code

To give specific users access to exclusive content, you’ll want to give those pages specific Custom Capabilities and then assign those users the Custom Capabilities for the pages you want to give them access to. Please see this video for more on Custom Capabilities. To assign those ccaps to specific users, this could be done by integrating [s2If /] (Simple Shortcode Conditionals) into your content.

Restrict content using Custom Capabilities (ccaps) and [s2If /] conditionals

[s2If current_user_can(access_s2member_ccap_exclusive)]
   Insert exclusive content here.
[/s2If]

To automatically assign new users one or more Custom Capabilities, you simply add those Custom Capabilities to the ccaps=”” attribute in your Paypal (Buy Now) Pro-Form shortcode. When the user signs up with that Paypal (Buy Now) Pro-Form, they’ll automatically get those Custom Capabilities and therefore have access to the pages restricted to them.

Generate Paypal (Buy Now) Pro-Form shortcode

[s2Member-Pro-PayPal-Form level="1" ccaps="exclusive" desc="Exclusive access to online content" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="example.com" ta="0" tp="0" tt="D" ra="0.01" rp="1" rt="L" rr="BN" rrt="" rra="2" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="1" default_country_code="" captcha="0" /]

If you want to extend this further, you can use a success="" attribute that will redirect users to a Thank you page after they sign up on your Membership page. See: http://s2member.com/kb-article/creating-a-registration-thank-you-page/#toc-3a5b356b