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™

s2Member Pro Forms ( dynamically via PHP )

s2Member Plugin. A Membership plugin for WordPress®.

s2Member Pro Forms ( dynamically via PHP )

Postby Jason Caldwell » July 18th, 2010, 12:25 am

Am I able to use the Paypal Pro Form in the template files?

Yes, you can build Pro Forms dynamically, using this function:
Code: Select all
echo ws_plugin__s2member_pro_paypal_form($attributes); 

Where $attributes, is an associative array containing the same attributes as the Shortcode for a Pro Form. You can generate a Shortcode for a Pro Form, under: s2Member -> PayPal Pro Forms, which will give you the attributes you need. After you do this a few times, you'll be able to bypass the Shortcode generator all together, if you prefer.

So here is a quick example:
Code: Select all
<?php

$attributes 
= array(
"level" => "1",
"ccaps " => "",
"desc" => "Description and pricing details here.",
"ps" => "paypal",
"cc" => "USD",
"custom" => "www.example.com",
"tp" => "0",
"tt" => "D",
"ra" => "0.01",
"rp" => "1",
"rt" => "M",
"rr" => "1",
"accept" => "paypal,visa,mastercard,amex,discover,maestro,solo",
"accept_via_paypal" => "paypal"
);

echo ws_plugin__s2member_pro_paypal_form($attributes);
?>

This tip has been posted for developers only.
None of this is required. The recommended method is through WordPress Shortcodes. In other words, you can skip this advanced method, by just going to: s2Member -> PayPal Pro Forms. That is the easiest way. This advanced technique is designed to maximize the flexibility of s2Member Pro for developers integrating s2Member Pro for their clients.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: s2Member Pro Forms ( dynamically via PHP )

Postby ricarod » August 7th, 2011, 6:12 pm

Jason great tip. Now what will be the code if using authorize.net?

I noticed given code makes some references to paypal so I would assume few differences should be set up for proforms when authorize.net, right?
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: s2Member Pro Forms ( dynamically via PHP )

Postby ricarod » August 8th, 2011, 8:13 am

BTW I tried adding this and didn't work:

Code: Select all
<?php

$attributes 
= array(
"level" => "1",
"ccaps " => "",
"desc" => "PRODUCT DESCRIPTION.",
"ps" => "authnet",
"cc" => "USD",
"custom" => "SITE",
"tp" => "0",
"tt" => "D",
"ra" => "1.99",
"rp" => "1",
"rt" => "L",
"rr" => "BN",
"accept" => "paypal,visa,mastercard,amex,discover",
"accept_via_authnet" => "authnet"
);

echo 
ws_plugin__s2member_pro_authnet_form($attributes);
?>
Last edited by Cristián Lávaque on August 8th, 2011, 3:15 pm, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: s2Member Pro Forms ( dynamically via PHP )

Postby Cristián Lávaque » August 8th, 2011, 3:14 pm

viewtopic.php?f=40&t=12462&src_doc_v=110710

It looks like it'd be written like this now

Code: Select all
echo c_ws_plugin__s2member_pro_authnet_form::sc_authnet_form($attributes);
 
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: s2Member Pro Forms ( dynamically via PHP )

Postby ricarod » August 8th, 2011, 3:22 pm

Awesome! Highly impress with your effectiveness and response time once again ;)
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: s2Member Pro Forms ( dynamically via PHP )

Postby Cristián Lávaque » August 8th, 2011, 4:19 pm

:)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron