I’ve just redeployed the Donation Cloud plugin for WordPress by Alex Günsche on Visser Labs, it’s sitting in the right sidebar.
I made a note when I was last using Donations Cloud to add a minimum donation check to ensure that all donations are larger than the minimum specified in /wp-content/plugins/donationscloud/settings.php
and consequently create a link in the link cloud. Here’s how I did it.
- Open up
/wp-content/plugins/donationcloud/donationscloud/donationscloud.php
with a text editor. - Locate the
function dc_checkform()
on line #23 - Replace line #23 starting with
function dc_checkform() {
to line #29 ending with}
below: - Save changes and upload the modified file
function dc_checkform() { if (dc_get('pp_amount').value == '') { alert("<?php _e("Please enter a donation amount.", 'donationscloud') ?>"); return false; } if (Number(dc_get('pp_amount').value) < '<?php echo DC_MIN_LINK_AMOUNT; ?>') { alert("Please enter a minimum donation amount of $<?php echo DC_MIN_LINK_AMOUNT; ?>.00."); return false; } if (dc_get('pp_website').value == '' || dc_get('pp_website').value == 'http://') { alert("<?php _e("Please enter your website's URL.", 'donationscloud') ?>"); return false; } if (dc_get('pp_linktext').value == '') { alert("<?php _e("Please enter a link text.", 'donationscloud') ?>"); return false; } return true; }
What this new line does is check the minimum link amount specified in settings.php
against the amount that is about to be donated, if it is below the minimum value (e.g. $10.00) then a popup message notifies the generous visitor to increase their minimum donation. This code is now running on Visser Labs, try it out.