Page 1 of 2

Force Terms/Conds Agreement via PayPal Button

PostPosted: March 22nd, 2011, 9:39 pm
by Jason Caldwell
Many site owners ask me if there is a way to force Customers to agree to their Terms/Conditions before they are allowed to continue with checkout. There are many ways to accomplish this, and the solution that you choose might be different, depending on whether you're using s2Member, or s2Member Pro.

s2Member Pro Forms ( via Custom Registration Field )
If you're using s2Member Pro with PayPal® Pro Forms, or Pro Forms for Authorize.Net® integration, the simplest way to accomplish this is with a Custom Registration Field that you configure with s2Member. In your Dashboard, under: s2Member -> General Options -> Custom Registration Fields, you can create a Checkbox field that is required, and in your description of this field, you can even include HTML code that may provide a link to your Terms/Conditions. ~So this is pretty simple, because your site is already integrated with s2Member Pro Forms. In other words, checkout occurs on your site! Very simple.

s2Member Payment Buttons ( i.e. PayPal® Standard, or similar )
In this case, checkout does NOT actually take place on your site. All you're doing is providing the potential Customer with a Payment Button, which sends them through the checkout process at PayPal®, or perhaps at ClickBank®, AliPay®, Google® Checkout, or another Payment Gateway that integrates with s2Member through the application of Payment Buttons.

In this case, you don't have s2Member Pro Forms working for you, so you'll need to be a little more creative. The code sample below will accomplish this for you. You'll need to make sure that you paste this into the HTML Tab of your Post/Page editor in WordPress®; otherwise the code will get corrupted by the Visual Editor. Be sure to replace [s2Member-PayPal-Button ... output="url" /] with your own ShortCode.
Code: Select all
<form onsubmit="return false;">
    <input id="our-terms-conds" type="checkbox" /> Yes, I agree to the Terms/Conditions.
    <a href="[s2Member-PayPal-Button ... output="url" /]" onclick="if(!document.getElementById('our-terms-conds').checked){ alert('You MUST check the box that you agree.'); return false; }"><img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" border="0" alt="PayPal®" /></a>
</
form> 
* Always use output="url" in your Shortcode.
That part of your Shortcode must be configured manually when you use this technique.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 10th, 2011, 11:15 am
by Black Dynamite
I'm using the free version of S2Member and would like to ask users to enter their date of birth, sign up for email blast and force acceptance of terms and conditions before they can continue. All this is for free registration. I am not a programmer, so please walk me through this step by step. Thank you

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 10th, 2011, 12:33 pm
by Cristián Lávaque
Try using the custom registration fields. WP Admin -> s2Member -> General Options -> Custom Registration Fields/Options

The emails part, if you integrate s2Member with MailChimp or AWeber, could be done from the List Server settings. WP Admin -> s2Member -> API / List Servers -> Registration / Double Opt-In Box

http://www.s2member.com/api-list-servers-video/

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 11th, 2011, 10:29 am
by Black Dynamite
Ok, so I configured the email. THANK YOU

I'm a bit lost on how to set up the birthday as well as forcing terms and conditions. If you could do it step by step again I can handle it.

P.S. The video helped a lot.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 11th, 2011, 1:54 pm
by Cristián Lávaque
Cool. Here's a video for the General Options, where the custom registration fields panel is: http://www.s2member.com/general-options-overview-video/

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 11th, 2011, 11:02 pm
by Black Dynamite
So I went through several of those videos and I do NOT know what to do.

All I want to do is ADD a DOB field MM/DD/YYYY, but I don't know what to choose in START A NEW SECTION>FORM FIELD TYPE> FIELD LABEL/DESC>UNIQUE FIELD ID>

DEFAULT TEXT VALUE>
EXCEPTED FORMAT>

If you could answer these for me it would help a lot?
---------------------------
More over, you haven't showed me or told me anything that will let me force TERMS and CONDITIONS before a user can successfully register. Can you help?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 11th, 2011, 11:17 pm
by Cristián Lávaque
- Unique Field ID is to identify the field (e.g. date, terms).
- Field Label/Desc is how it'd be shown in the form (e.g. Date of Birth, Terms & Conditions).
- Starts A New Section can be No if it doesn't start a new section in the form.
- Form Field Type can be checkbox for the T&C and text for the DOB.
- Default value is what the form would have written in the field before the user inputs anything.
- For the T&C Field Required: yes.
- For the date, Expected Format: Date.

I hope that helps.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 11th, 2011, 11:41 pm
by Black Dynamite
A little. So I made a check bod for T&C, but where would a users read the T&C?

DOB... is the only way a user can enter DOB by text?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 11th, 2011, 11:52 pm
by Black Dynamite
Ok, so I solved the DOB issue thanks to your help. Just use Text single line and select the Expected Format.

So the last thing in regards to this topic is T&C. I created the check box, but there's nothing for them to read. lol.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 12th, 2011, 10:56 am
by Cristián Lávaque
You can make the description an HTML link to your T&C doc.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 12th, 2011, 9:40 pm
by Black Dynamite
How do you do that?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 12th, 2011, 9:45 pm
by Cristián Lávaque
Like in a normal web page, only you put the anchor tag for the label of the Custom Registration Field. Google HTML anchor tag.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 12th, 2011, 10:46 pm
by Black Dynamite
ALRIGHT! You've been a great help in those areas.
Now, while I still have you can I ask you if there is a way to restrict access to anyone younger than 7 and over 18?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 12th, 2011, 10:49 pm
by Cristián Lávaque
No, s2Member doesn't have that yet. I'm sure you could probably have it custom coded to add that functionality, though.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 24th, 2011, 2:31 am
by esljosh
Jason,

My theme (or something) doesn't like the comments generated by the short codes for the paypal buttons, so your code at the top...

<form onsubmit="return false;">
<input id="our-terms-conds" type="checkbox" /> Yes, I agree to the Terms/Conditions.
<a href="[s2Member-PayPal-Button ... output="url" /]" onclick="if(!document.getElementById('our-terms-conds').checked){ alert('You MUST check the box that you agree.'); return false; }"><img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" border="0" alt="PayPal®" /></a>
</form>


Doesn't work for me... do you have any suggestions?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: August 25th, 2011, 3:33 am
by Cristián Lávaque
Josh, you shouldn't get button code when you output a URL. Could you please post here the code you're using?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 1st, 2011, 3:21 pm
by s_d_p
I'm trying to force users to agree to terms and conditions when trying to purchase access to a specific post/page. We want to allow guest access to the site, so it doesn't help me to add the custom field to the registration page (since some users will never register). I'm using the S2Pro. Is there a way to insert a custom field into the paypal pro form? Thanks!

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 4th, 2011, 3:57 am
by antseo
Is it possible to place a TOS checkbox on the registration form instead of the paypal button?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 5th, 2011, 12:56 am
by Cristián Lávaque
Yes, it's been explained a few replies above. You create a required custom registration field, a checkbox, and make the description an HTML link to your T&C doc. WP Admin -> s2Member -> General Options -> Custom Registration

I hope that helps. :)

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 5th, 2011, 1:11 am
by antseo
thanks, figured it out.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 5th, 2011, 9:26 am
by s_d_p
This makes me feel stupid, but I'm still not clear on how this should work. I've created the custom field several times, but it doesn't appear when I create a pro form. That admin panel has this under the field:

Examples: country_code, street_address
e.g. [s2Get user_field="country_code" /]

My field is called tou... so does this mean that I place [s2Get user_field="tou" /] somewhere? If so, where?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 5th, 2011, 10:35 am
by s_d_p
Aha. The custom field DOES appear on my registration form for my site. But this is not the solution to my questions. I want to add a custom field (terms/conditions) to my PRO FORM when a user buys access to a specific page/post. So I guess I'm restating my question: can I add a custom field to my pro form?

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 6th, 2011, 2:00 pm
by Jason Caldwell
I see, thanks for your clarification.

Sorry, Custom Registration/Profile Fields for s2Member, are only supported for Users/Members. So while it is possible to do what Cristián was talking about, with a Custom Registration Field, it is NOT possible to do this with a Pro Form for "Specific Post/Page Access", because that functionality is designed to work independently from Membership Level Access. That is, Specific Post/Page purchases do not support Custom Registration Fields.

What you CAN do though, is create a custom template for Specific Post/Page Access, and build a checkbox for T&C into your template. Then specify your custom template in the Pro Form Shortcode for s2Member.
Code: Select all
[s2Member-PayPal-Pro-Form ... template="my-template.php" /]
( This Shortcode is abbreviated for clarity in this regard )

Is it possible to modify the PayPal® and/or Authorize.Net® Pro Form templates?
Usually not necessary. But yes, if you really need to. Please check your /s2member-pro/includes/templates/forms/ directory. You can take the default templates, and place some ( or all of them ) into your own WordPress® theme directory. s2Member Pro will automatically find your custom templates there. By placing custom templates into your theme directory, you can be sure they won't get overwritten in a future upgrade. Either that, or you can just use the default templates like they are, and customize them with your own CSS rules inside the Stylesheet for your WordPress® theme ( i.e. style.css ). If you're using a PriMo Theme ( for instance, the s2Clean Theme ), check your Theme Options Panel, under: Custom CSS / Style Sheet.

So, in your case, take this file:
/s2member-pro/includes/templates/forms/paypal-sp-checkout-form.html
Make a copy in your WordPress theme directory and modify it however you like. If you rename the template file, be sure to specify the new name in the template="" Attribute of your Shortcode.

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 6th, 2011, 3:52 pm
by s_d_p
This is great. Exactly what I was looking for. One follow-up question...
I need to make my "Terms and Conditions" checkbox mandatory. Can you point me to the script that handles the form? (The template file has a %%action%% shortcode)

Re: Force Terms/Conds Agreement via PayPal Button

PostPosted: September 6th, 2011, 3:59 pm
by Jason Caldwell
Very welcome.
Add an submission handler to the Pro Form.

Something like this at the bottom of your template file perhaps:
Code: Select all
<script type="text/javascript">
(function($)
    {
        $('form#s2member-pro-authnet-sp-checkout-form').submit (function()
            {
                if (/* Run your conditional here. */)
                    {
                        alert('Please check the box that you agree!');
                        return false;
                    }
                else
                    return true
;
            });
    })(jQuery);
</script>