s2Member Pro Forms ( dynamically via PHP )
Posted: 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.