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™
With s2Member Pro installed, you have access to the s2Member Pro Login Widget. This is made available in your Dashboard under: Appearance -> Widgets. Very simple to use; just drag & drop ( that's it ). For developers though, sometimes it is necessary to include the Pro Login Widget in non-widgetized sections of a WordPress® theme; or even into another plugin that you run in concert with s2Member. You can use this PHP tag to build the Pro Login Widget dynamically: <?php echo s2member_pro_login_widget(); ?> . The Pro Login Widget can also be configured with an optional array of configuration parameters ( as documented below ).
This function allows for the inclusion of the Pro Login Widget directly into a theme/plugin file.
This API function will return the HTML output from the widget function call.
Example usage: <?php echo s2member_pro_login_widget($options, $args); ?>
The $options parameter (array) is completely optional ( i.e. NOT required ).
It can be passed in as an array of options; overriding some or all of these defaults:
- Code: Select all
"title" => "Membership Login" ——— Title when NOT logged in, or leave this blank if you'd prefer not to show a title.
"signup_url" => "%%automatic%%" ——— Full Signup URL, or use %%automatic%% for the Membership Options Page. If you leave this blank, it will not be shown.
"login_redirect" => "" ——— Empty ( i.e. "" ) = Login Welcome Page, %%previous%% = Previous Page, %%home%% = Home Page, or use a full URL of your own.
"logged_out_code" => "" ——— HTML/PHP code to display when logged out. May also contain WP Shortcodes if you like.
"profile_title" => "My Profile Summary" ——— Title when a User is logged in. Or you can leave this blank if you'd prefer not to show a title.
"display_gravatar" => "1" ——— Display Gravatar image when logged in? 1 = yes, 0 = no. Gravatars are based on email address.
"link_gravatar" => "1" ——— Link Gravatar image to Gravatar.com? 1 = yes, 0 = no. Allows Users to setup a Gravatar.
"display_name" => "1" ——— Display the current User's WordPress® `Display Name` when logged in? 1 = yes, 0 = no.
"logged_in_code" => "" ——— HTML/PHP code to display when logged in. May also contain WP Shortcodes if you like.
"logout_redirect" => "%%home%%" ——— Empty ( i.e. "" ) = Login Screen, %%previous%% = Previous Page, %%home%% = Home Page, or use a full URL of your own.
"my_account_url" => "%%automatic%%" ——— Full URL of your own, or use %%automatic%% for the Login Welcome Page. Leave empty to not show this at all.
"my_profile_url" => "%%automatic%%" ——— Full URL of your own, or use %%automatic%% for a JavaScript popup. Leave empty to not show this at all.
The $args parameter (array) is also completely optional ( i.e. NOT required ).
It can be passed in as an array of options: overriding some or all of these defaults:
- Code: Select all
"before_widget" => "" ——— HTML code to display before the widget.
"before_title" => "<h3>" ——— HTML code to display before the title.
"after_title" => "</h3>" ——— HTML code to display after the title.
"after_widget" => "" ——— HTML code to display after the widget.
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.
codeshed wrote:It sounds like the s2Member Pro forms template is the way to go. Is this included in the Single-Site License — for $69
<?php echo do_shortcode('[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="3 Days free / then $7.99 USD / Monthly ( recurring charge, for ongoing access )" ps="paypal" cc="USD" ns="1" custom="www.site.com" ta="0" tp="3" tt="D" ra="7.99" rp="1" rt="M" rr="1" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" template="paypal-registration-form.html" /]'); ?>
DrByte wrote:How do I capture and complete those variables to the paypal-checkout-form.html page
codeshed wrote:Using the s2Member Pro forms template but not PayPal Pro, we would like to have radio button fields for different payment option types. IE Monthly Recurring or Yearly. How do we pass the option variable chosen on the form to the PayPal Gateway?.
codeshed wrote:1)Registration Form (paypal-checkout-form.html) After submitting and paying this form we get redirected back from the PayPal gateway to paypal-checkout-form.html with a message at the top saying "Thanks for registering......" with a blank registration form below. How do we sent the user to a different feedback page without the registration form below? Toggle on 2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
doesn't seem to work, as it does not return any value.
codeshed wrote:1)Registration Form (paypal-checkout-form.html) After submitting and paying this form we get redirected back from the PayPal gateway to paypal-checkout-form.html with a message at the top saying "Thanks for registering......" with a blank registration form below. How do we sent the user to a different feedback page without the registration form below? Toggle on 2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
doesn't seem to work, as it does not return any value.
codeshed wrote:2)Pro Login Widget via PHP Tag We are using the s2Member Pro Login Widget but there seems to be some issues. When we submit the form and it results in validation errors, the form submits to the "Stand Alone (Default Wordpress login page) . How do we ensure that validation of this form stays on the page in which we have the widget placed ?
codeshed wrote:3) How do we create the Forget Password Form similar to the behaviour with the Pro Login Widget via PHP meaning placing it within a page template and making sure we are not redirected out to the stand alone default form.
DrByte wrote:Think of it like your pro login widget but instead, it's a registration widget that includes the first part of the form (first, last, ...) and not the credit card part which follows when then submit
The reason behind this is to have the registration form present all the time to none members. the chances is that visitor will see it is high and increase the chances to buy the membership.
Cristián wrote:That seems like a good idea.
It could be easily achieved if the Pro-Form prefilled fields with values in $_POST or $_GET.
$_POST["s2member_pro_paypal_checkout"]["first_name"]
$_POST["s2member_pro_paypal_checkout"]["last_name"]
$_POST["s2member_pro_paypal_checkout"]["email"]
$_POST["s2member_pro_paypal_checkout"]["username"]
$_POST["s2member_pro_paypal_checkout"]["password1"]
$_POST["s2member_pro_paypal_checkout"]["password2"]
$_POST["s2member_pro_paypal_checkout"]["custom_fields"]["my_custom_field_id"]
$_POST["s2member_pro_paypal_checkout"]["custom_fields"]["another_custom_field_id"]
$_POST["s2member_pro_paypal_sp_checkout"]["first_name"]
$_POST["s2member_pro_paypal_sp_checkout"]["last_name"]
$_POST["s2member_pro_paypal_sp_checkout"]["email"]
$_POST["s2member_pro_paypal_registration"]["first_name"]
$_POST["s2member_pro_paypal_registration"]["last_name"]
$_POST["s2member_pro_paypal_registration"]["email"]
$_POST["s2member_pro_paypal_registration"]["username"]
$_POST["s2member_pro_paypal_registration"]["password1"]
$_POST["s2member_pro_paypal_registration"]["password2"]
$_POST["s2member_pro_paypal_registration"]["custom_fields"]["my_custom_field_id"]
$_POST["s2member_pro_paypal_registration"]["custom_fields"]["another_custom_field_id"]
Jason Caldwell wrote:Yes, that's a good point. It's not possible with $_GET variables ( yet ), but it is possible to do this with $_POST variables. You can pre-fill form fields for a checkout form like this.
<form method="POST" action="http://www.example.com/my-checkout-page/">
<p>
<label>First Name:</label><br />
<input type="text" name="s2member_pro_paypal_checkout[first_name]" value="" />
</p>
<p>
<label>Last Name:</label><br />
<input type="text" name="s2member_pro_paypal_checkout[last_name]" value="" />
</p>
<p>
<label>EMail Address:</label><br />
<input type="text" name="s2member_pro_paypal_checkout[email]" value="" />
</p>
<p>
<label>Username:</label><br />
<input type="text" name="s2member_pro_paypal_checkout[username]" value="" />
</p>
<p>
<label>Password:</label><br />
<input type="text" name="s2member_pro_paypal_checkout[password1]" value="" />
</p>
<p>
<label>Password ( please type it again ):</label><br />
<input type="text" name="s2member_pro_paypal_checkout[password2]" value="" />
</p>
<p>
<label>My Custom Field:</label><br />
<input type="text" name="s2member_pro_paypal_checkout[custom_fields][my_custom_field_id]" value="" />
</p>
<p>
<label>Another Custom Field:</label><br />
<input type="text" name="s2member_pro_paypal_checkout[custom_fields][another_custom_field_id]" value="" />
</p>
<p>
<input type="submit" value="Continue To Checkout" />
</p>
</form>
Return to Common Questions/Problems/Tips
Users browsing this forum: No registered users and 1 guest