The Spotlight
The Official Blog of The Patron Edge

Rounding up change (but not from under sofa cushions)

The PEO Labs series brings you information or advice on items that are geared towards users who can take high-level concepts or sample code and run with them. Please note that many of the things discussed are not supported. That doesn't mean that an item is a warranty-voider; it just means that the Support Analysts can't walk you through it or troubleshoot it if it breaks.

Over the last few months I've noticed that electric and water companies are really pushing the "round up" thing to work on public projects. So why not do something similar for Patron Edge Online? With a bit of ASP and JavaScript, we can find out how much a patron's total order is, then display a message asking if he would like to round the total up to the next dollar and give the remainder as a donation. The concept is simple, the patron doesn't mind giving away the electronic equivalent of spare change, and you get a donation towards your annual fund. Everyone wins! 

Here you will find a zipped file containing two SQL scripts and an ASP page called round_up.asp. This page checks to see if the patron has already put a donation in her basket. If she has not, it will auto-magically display and ask if she would like to round the total up to the next dollar as a donation. It does not just look for totals that are even dollar amounts; a total of $42.30 would add a $0.70 donation and a total of $42.00 would add a $1.00 donation.

To install:
1. Place round_up.asp into your PEOSite\bbCustomizations folder
2. If you do not already have the eSroCstmSiteSettings custom table, run Create Custom Site Settings Table.sql on the PEO database
3. Run Round Up Feature.sql on the PEO database
4. Go to Administration, Custom Tables, eSroCstmSiteSettings and set Donation Round Up Fund to the desired code (found in Content, Donation)
5. Drill into the screen parts of my_basket.asp for the appropriate interface
6. Set round_up.asp as an Include After on the basket view screen part, or create a new screen part below the basket view in the desired location

The page is pretty basic and I created it in about 4 hours over the course of a weekend. It would have taken about half that if I had ever taken a programming class (the life of a French/Business major, *sigh*). Please note that this is custom PEO code. It is not supported (which just means my analysts cannot answer questions about it) but works beautifully on my system. Still, be sure to test before putting it on your live site; I claim no responsibility if it breaks your site, burns your supper or lets your dog out of the fence!

Did you find the round up feature useful? Would you like to see more of this kind of thing on the site? Leave a message in the comments.

Comments

Cinda Barbuto said:

Nicholai....you are a genius!

# June 5, 2008 9:42 AM

Shannon Wilson said:

Hey!  Of course this is a great feature Nicholai - I do have to ask... Do we need to DONATION module to implement this though?  

Thanks!

# June 5, 2008 6:22 PM

Nicholai Burton said:

@Cinda - Thank you!

@Shannon - Yeah, it does require the Donations module.

It's good to start getting some comments; I was starting to wonder if anyone actually read the Spotlight!

# June 6, 2008 5:09 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)