The PayPal Mini Cart

I’ve been hard at work lately, but I managed to release my newest invention through PayPal Labs: the Mini Cart. It’s a JavaScript file which can be included on your PayPal cart enabled site to create an editable cart overlay when the user adds items. This helps enhance the user experience by keeping them on your website rather than being redirected away to PayPal with each click.

To see a demo along with integration details please visit the official website: https://minicart.paypal-labs.com/.

For those curious on how it works, it’s actually pretty easy: the HTML for the cart pages is in a predictable format so the script is finding all of the form elements on the page with a cmd=_cart and hijacking them. Instead of submitting as expected, each form has it’s contents parsed and a DOM structure is created for the Mini Cart. The data from the overlay is then stored in a cookie to keep it persistent between page loads. When the user proceeds to checkout, the data is processed as a third-party cart upload and the user is sent, finally, to PayPal for their payment.

The feature is still new and I’ll be working to expand upon it so if there’s any feedback let me know.