I do A LOT of voice over work - mostly for training videos in Drupal, Joomla and Mautic - but that seems to be expanding.

Here's the latest video for the introduction of Drupal 8.4 (launched October 4th, 2017)

 

 

 

I had a friend ask if I could create a donation/membership page for their non-profit using PayPal.  The site is built in Joomla! 3.x so I naturally thought of an excellent extension like JoomDonation.  However, they wanted a number of tweaks that meant modifying the extension which I hesitate to do.  Enter RSForm! Pro.  It's pretty much been my go-to form builder on any Joomla! site I've built over the years.

Basic View:

SafariScreenSnapz069

 Requirements:

  • Select a pre-set amount or enter a custom donation amount.
  • One-Time or Recurring donations (recurring donations required a PayPal account - users would manage them there...)
  • Recurring Donations on a Monthly, Quarterly, Semi-Annual or Annual basis.
  • Recurring donations would be empty for on-going donations, or at least 2, since 1 throws an error at PayPal.  (RSForm has a "range" validation feature).
  • Clean looking.
  • If you clicked on the Custom Donation Amount a field appears, allowing the amounts to be a required field, even if a donor chose the custom option.

Code: (download at the bottom of the article)

The magic happens upon form submission.  The php tests for all the variables then sends the appropriate link to PayPal. (Please don't write to me and tell me my code could be improved... I know it could. - I haven't done any coding in years lol).

/*Recurring Donation */
if ($_POST['form']['recurring'] == 'Recurring')
{
$business = '';;
/* getting the donation name */
if ($_POST['form']['other'][0] != '') {$item_name = str_replace($replace, $with, 'Custom Amount');}
if ($_POST['form']['membership'][0] != '0') {$item_name = str_replace($replace, $with, '{membership:text}');}
/* getting the donation amount */
if ($_POST['form']['membership'][0] != '0') {$total = str_replace($replace, $with, '{membership:value}');}
/* getting duration and frequency for PayPal */
$duration = str_replace($replace, $with, '{duration:value}');
$frequency = str_replace($replace, $with, '{frequency:value}');
if ($frequency == 'Q') {$p3 = '3'; $t3 ='M';}
if ($frequency == 'Y') {$p3 = '1'; $t3 = 'Y';}
if ($frequency == 'S') {$p3 = '6';$t3 ='M';}
if ($frequency == 'M') {$p3 = '1';$t3 ='M';}
/* PayPal variables set */
$currency_code = 'USD';
$a3 = $total;
$src = '1';
$srt = $duration;
$no_note = '1';
/* upon successful completion of the donation, RSForm will update the status from Pending to Accepted */
$notify_url = JURI::root().'index.php?option=com_rsform&formId='.$formId.'&submission='.$SubmissionId;
$url= 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business='.urlencode($business).'&item_name='.urlencode($item_name).'&currency_code='.urlencode($currency_code).'&a3='.urlencode($a3).'&p3='.urlencode($p3).'&t3='.urlencode($t3).'&src='.urlencode($src).'&srt='.urlencode($srt).'&no_note='.urlencode($no_note).'&notify_url='.urlencode($notify_url);
$app = JFactory::getApplication();
$app->redirect($url);
exit();
}
/* One Time Donation */
if ($_POST['form']['recurring'] == 'One Time')
{
if ($_POST['form']['membership'][0] != '') {$item_name = str_replace($replace, $with, '{membership:text}');}
if ($_POST['form']['other'][0] != '') {$item_name = str_replace($replace, $with, 'Custom Amount');}
if ($_POST['form']['other'][0] != '') {$total = str_replace($replace, $with, '{other:value}');}
if ($_POST['form']['membership'][0] != '0') {$total = str_replace($replace, $with, '{membership:value}');}
$currency_code = 'USD';
$a3 = $total;
$p3 = '0';
$t3 = '1';
$src = '0';
$no_note = '1';
$notify_url = JURI::root().'index.php?option=com_rsform&formId='.$formId.'&submission='.$SubmissionId;
$url='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=design@navigatetomorrow.com&item_name=One+Time+Donation&amount=' .$total .'&currency_code=USD&notify_url='.urlencode($notify_url);
$app = JFactory::getApplication();
$app->redirect($url);
exit();
}

Test It Out

Feel free to test out the form - you can even send a donation if you'd like :)

Donations & Memberships

First Name(*)
Invalid Input

Last Name(*)
Invalid Input

Email(*)
Invalid Input

Choose either a set amount or enter a different amount below.
Note: A Patron Level Donation/Membership automatically renews your Basic Membership for that year.
Membership(*)

Invalid Input

Other Amount: $
Invalid Input

Donation Type
Invalid Input

Please select a frequency
Invalid Input

Number of Donations
Invalid Input

Invalid Input

Download

To use this code you must have a Joomla 3.x website (minimum) and a copy of RSForm! Pro.

Download

So, I'm on a plane heading to San Francisco for a week of training with OSTraining. I picked up the new Macbook this week as I prepped for a trip to San Francisco. I spent about 30 minutes playing with Apple's newest ultra-light laptop a few weeks ago and wasn't quite convinced. The new keyboard is definitely an acquired taste and the new trackpad has a ton of hidden tricks that I wasn't sure I'd ever use. The computer feels under-powered for anything beyond basic presentations, email, web browsing and hand-coding CSS or websites.

Read more: Field Testing Apple's New MacBook

As readers of this blog know, I create a LOT of training video for OSTraining.com. I'm up around the 400 mark these days. Last week I cranked out 30 new videos for an update to our Drupal Intermediate course, first published over two years ago. The microphone I used back then was a pretty good Logitech headset (no longer available) and I thought the audio was decent enough for screencasts. I'm now using the MIC from Apogee. While this is still not a high-end"podcast" quality mic, it only cost $199.

Read more: The Value of a Good Microphone

I'm not the greatest blogger in the world… (yeah – no kidding) – I sometimes find it difficult to commit the time to just keeping it up.
So in the spirit of trying to do better – I purchased an app from Apple today called Blogsy.

Read more: Testing a New App!