Adding a View Cart Link without access to the PayPal Account.

PayPal offers a simple, quick way for people to start taking payments online, instantly. The learning curve is smooth and most people get set up and start taking payments within days.

I sub-contract some freelance work on the side and one of the recent requests was to include a ‘View Cart’ Link across the footer of the website.This wasn’t a full-fledged e-commerce website, it was made up of static HTML pages that held item descriptions, images and individually generated PayPal ‘ Add to Cart ‘ buttons.

Currently the only way to get to the cart was to click the buy link and be transferred to the hosted cart at the PayPal website. The client wanted users to get to the cart directly without having to add an additional item to the cart.

Without access to the PayPal account, I was looking for a simple way to create the ‘View Cart’ buttons and began unsuccessfully scouring forums. Most threads on the topic suggested the link needed to be generated from within the clients PayPal account, But I did find a simple link to the view cart at the PayPal developer network

View cart:
<a href=”https://www.paypal.com/cart/display=1&business=yourdomain@yourdomain& target=”paypal”>View Cart</a>

The only missing piece was finding what email they were using. Simple ‘View Source’ of their landing pages unearthed the email being used. It was being sent over form POST as a hidden field

<form name=”form” target=”paypal” action=”https://www.paypal.com/cgi-bin/webscr” method=”post”>

<input type=”hidden” name=”cmd” value=”_cart”>

<input type=”hidden” name=”business” value=”joe@XXXXXX.com“>

<input type=”hidden” name=”currency_code” value=”USD”>

Thats all it took. A quick ‘Find and Replace’ later I had the links working site-wide. Although it may not apply to all readers, I decided to blog about this in case someone was working with PayPal or thinking of using it to accept payments, sell items etc…