WP e-Commerce - A Theme Developers Nightmare

update: WP eCommerce has updated to 3.8 which makes things much better. Still a few template issues but we're on the right track. I'll certainly try to update with thoughts on the update.

This week I've worked on 3 different e-commerce projects. Two worked with WP e-Commerce and one with Shopp. Admitely the Shopp work was mainly around getting SSL working properly on the site so I can't comment on the themeing of the plugin but I can comment on building a WP e-Commerce theme and boy is it 'fun'.

Get Started

To get started building a theme for WP e-Commerce you have to dig into the plugin and move some theme files into wp-content/uploads/wpsc/themes. Somehow WP e-Commerce can create that folder for you but not move the themes over? The second step is to duplicate the default theme and rename the folder to be whatever you'd like in your theme. Don't forget that whatever your folder is called your stylesheet also has to be called, which seems pretty stupid to me. Why doesn't it just recognize a styles.css file in any theme?

So now that we've got a theme going there are a few more questions. Why on earth can't you just place the theme files into the main WordPress theme? Sure keep backwards compatibility so that the current system works but for those doing some type of automated deployment of themes (like me to multiple servers) I've now got to setup a totally different deployment scheme for the e-commerce theme. Since I also work in Git all the time I always exclude the uploads folder because I don't want to automatically deploy images to servers where they aren't linked to a corresponding post. So yeah I have to set up a new git repository then go over to Beanstalk and set up a new deployment. It's just another thing that makes WP e-Commerce a pain to work with.

It Gets Worse

While the few items above are just little complaints that cost me time, we really get into some terrible when we crack open the default theme for WP e-Commerce. It seems that the developers of WP e-Commerce don't know what an include is in PHP. Want to modify the breadcrumbs code? Yeah that's in 4 files. How about the purchase button, again in 4 files. This is a sign of bad programming. It's a programmers axiom that as soon as you use the same code in more than one spot you need to abstract that code and move it into a spot where it can be accessed from both files. Then updating becomes a matter of just one change which will propagate across multiple files. I took it upon myself to try and fix this by taking the default WP e-Commerce theme and using includes.

The other item that really bugs me about the duplication of code is that if you were able to move all the WP e-Commerce template files in to your WordPress theme you'd be able to take advantage of all the WordPress goodness that stops code duplication like get_template_part and locate_template. Alas you can't have the template files in your main WordPress theme so you can't.

Now I've take a look at the themes for the 3.8 release and they've done some clean up in the duplicated code world but there is still some more work to be done. Breadcrumbs are now built out of a single function call, we've got improvement but there is still a bunch of room for more.

Oh It's Worse than that

Sure code duplication is pretty dang bad but there is something worse to be found inside the guts of WP e-Commerce. Thickbox effects for the design side are built right in to the plugin. Don't like the Thickbox effect on the alternate image? Guess you have to hack the plugin to remove it then write your own functionality. I honestly can't fathom why the effect is 'required' in this manor, especially since when you look up the Thickbox site it's not even supported.

WP e-Commerce should have an option (or something) that lets you turn off the javascript effects that are purely presentational like Thickbox. Sure keep the stuff that lets the cart get updated by AJAX but if it's purely presentational let us turn off the default easily.

And the Icing on the Cake

Again I'll state that I'm looking at all of this from a Theme Developers perspective so I'll admit that many people may not have this issue. To get alternate views Gold Cart is required, which is entirely fine I don't mind supporting good work by paying for it. I own Gravity Forms, WP Touch Pro and a number of plugins from Plugin Buddy. What is so terrible about Gold Cart is that the single license is just that, one working copy of it.

At the very least Gold Cart should work fine when running on localhost since it's on a local development machine. I understand that they want to ensure people pay for the plugin by having it really only run in one registered environment, but this is a PITA. It's not like I'm using the plugin to make money while it's running on my laptop so there is no real reason to have this limitation.

Is There Anything Good?

So after all that you're probably wondering if there is something good about WP e-Commerce. WP e-Commerce is the only WordPress ecommerce plugin that has a single page checkout. Shopp has a 3 page checkout which means you're going to loose sales on each page. Remember the title is talking about theme developers not store owners. For store owners this is a decent plugin that will keep your sales with the single page checkout, it's just going to drive your web developer nuts (yes more nuts that they are already).

So overall I'd say that WP e-Commerce is a plugin I'll keep recommending to clients despite the broken drag and drop ordering functions, terrible theme building experience and reliance on Thickbox inside the plugin not the theme. I'm going to do this because at the end of the day my clients business care most about a single page checkout. That's what will bring them the most money and heck taking all this extra time to build means I make extra money too so we both win (well sorta).