Project: Finding Aid Shopping Cart / Research Request
Impetus:
Archives often face challenges in managing manual submissions of requests to view materials. This project attempts to automate the activity of a user requesting items for consultation from a finding aid. As proof of concept, I applied a free, open-source shopping cart to items in an EAD-encoded finding aid container list, creating a user experience similar to a library catalog "bookbag."
Automation ensures that archives receive the information they need to effectively pull and track items/folders/boxes.
Outline of the project:
Using the simpleCart javascript shopping cart, I made the following adjustments to an EAD container list (example below taken from the Library of Congress EAD documentation, Appendix C). Boxes/folders/items may be populated into a shopping cart, and a summary is e-mailed to the archives.
As I have it, data is e-mailed with its EAD encoding, for easy transfer to other applications, such as a tracking database, call slip form, etc. But you can also set up the shopping cart with an HTML document, strip out the EAD encoding, or take many other approaches!
Here's what I did, to get you started and give you an idea of the simplicity of the concept and its implementation.
EAD file tweaks
Encase each < c02 > (or other level) with a < div > class="simpleCart_shelfItem"
Each < did > gets class="item_name"
Include the "item_add" command alongside every did
Add collection number to each box/folder number for identification
Note: what's great about this process is that standard EAD encoding can be edited with just a few 'find and replace' maneuvers to achieve the needed mark-up.
Changes to simpleCart.js
Change: me.checkoutTo = Email;
Add: this script and PHP file
Collecting User Contact Information
To keep things very simple, I've used a prompt to collect the patron's e-mail address and stored this as a var in the emailCheckout function, treating it the same as "jcitems" in both simpleCart.js and the PHP file.
To replicate, add these lines to simpleCart.js:
var email = document.createElement("email");
email = prompt("Please enter your e-mail address");
form.appendChild(me.createHiddenElement("email", email));
Add this line to the PHP file:
$email = $_POST['email'];
And tweak:
mail($to, $subject, $jcitems.$email, $headers);
Or come up with your own ideas! It's super simple to implement and customize simpleCart with EAD-encoded finding aids.