Paypal Shopping Cart Code for WordPress

I decided to do this as a page, rather than a post, so here’s the link to the code that I use for my homemade Paypal Shopping Cart for photos.

If you find your eyes glazing over while you read it – then hit the back button quickly.

If you are a web designer, then I don’t think it’s all that complex.  If you’re not – then it will look like a lot of work or worse, a reinvention of the wheel.  Though when I first wrote this I don’t think this particular wheel existed yet.

There are several paypal cart plugins for WordPress at this point so you might start with one of them instead.  On the other hand, this is actually pretty simple, and gives you flexibility that you might find hard to achieve with someone else’s plugin.  Shipping calculations and if I wanted to charge taxes – that sort of stuff is handled by how Paypal is set up, not with the cart.

Advertisements

Published by

Dave

My name is Dave Beckerman. I am a photographer and programmer working in New York City.

2 thoughts on “Paypal Shopping Cart Code for WordPress”

  1. Looking good! I recognise some of that code from my own dealings with PayPal but it’s always good to see someone else go through the details.

    Next thing is handling IPN perhaps? It’s a great way to give feedback to the user and log things on your server.

  2. Thanks (for those who don’t recognize the name) Donncha is the creator (okay, it’s based on wp-cache) of the Super-Cache plugin (which I of course use).

    Donncha – you know I’ve never even looked into IPN (though I know what it is). I’m thrilled to just get notified by email that I’ve sold some photos. I’m sure I could make a very good cart plugin that was specific for photographers (who do have needs that are different from the average product) – but the idea of having to support it (I used to be a developer) is terrifying.

    As far as IPN goes, I suspect that’s for vendors that are really doing a lot of sales – which leaves us poor photographers out of it. However, one feature I might add is the ability to download digital files. My problem there is not the technical part – but every digital sale I’ve done (as far as usage goes) has been different. One art buyer licensed 500 copies of two large prints for a hotel; and the next one is an individual who wants to make a poster for his college dorm. Someone licensed images to be used as decorative lampshades. and someone else wanted to know if I could retouch the photograph to remove some logos etc. It goes on and on. And I do tailor the price depending on these factors as well as who is doing the buying.

    In other words – some day I might have to sit down and see if I can figure out the rules for licensing which would involve asking a bunch of questions through a form.

Comments are closed.