This tutorial requires the use of the Code (5 Pack) SEBLOD Field set
This tutorial teaches you how to set up a simple PayPal donation form using a SEBLOD custom form.
- First, create your SEBLOD form, and set the "Create" permissions to whichever user group you need. For this example, I use "Public" because I want anyone to be able to make a donation. In my form I have the following important fields:
- Full name ('mem_full_name') [Text]
- Select Donation amount ('mem_donation') [Radio]
- Donation amount input field for a custom donation amount ('mem_donation_other') [Text]
- Create an AfterStore SEBLOD field
- Set the "Mode" to "Free"
- Use the following code with a preceeding
$item_name = ''.$fields['mem_full_name']->value.' Donation Form';
$currency_code = 'AUD';
$amount = $fields['mem_donation']->value + $fields['mem_donation_other']->value;
$return = 'http://www.yourwebsiteurl.com';
$app = JFactory::getApplication();
$link = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$business.'&item_name='.$item_name.'$currency_code='
Ensure you replace firstname.lastname@example.org with your actual PayPal email of the destination account, and replace http://www.yourwebsiteurl.com with the actual address you want people to be returned to after their payment. You should also replace 'AUD' with your currency of choice.Your form will now submit a content item in Joomla, and redirect to PayPal with the proper information after submission.