WordPress Custom Post Types & PHPurchase: Best Cart Ever – Part 1
Published 3 years 8 months ago on August 9, 2010 — 6 min read
If I had to choose one thing that’s been most frustrating about building websites throughout the course of my career it’d have to come down to one thing: shopping carts. I’m not sure why, but finding a shopping cart that’s going to support your needs as well as support genuine customization can be a daunting task.
The WordPress cart landscape
When it comes to WordPress, there are actually a number of shopping carts available. I think we can all cringe a bit when WP e-Commerce gets brought up. It’s arguably the oldest, most widely used e-commerce platform for WordPress today. I don’t have an official stance on the platform though. I’ve tried to install it a few times now and each time either not made it to, or not made it very far passed activation.
Not too long ago, a new kid showed up on the block: Shopp. I was really impressed from a ‘book cover’ stance and took the time to check it out. A few minutes into it I felt that the developers deserved some support for taking a WordPress e-commerce plugin seriously. I snagged myself a single site license and gave it a whirl. I really liked what I saw. The plugin did its part in mirroring design conventions established in WordPress itself, something I feel is very important to plugin development. On top of that, the bit I played around with it showed that it had a great balance of functionality and customization capability.
Shopp followed in WordPress’ footsteps by providing theme files and hooks to work with, something we all love about WordPress. The documentation looked to be actively defined and I was convinced I had my go-to plugin for e-commerce the next time it came up. I even pitched the plugin to a number of friends, some of which had cart projects on their plate and were in the market for a new plugin to check out.
I didn’t have any e-commerce plugins crop up over time, but I saw a few friends make a post here or there about some frustrations they were having with Shopp. To be as specific as I can without firsthand knowledge, it sounded like there may have been a few bugs to squash when it came to actual payment processing. Shortly after that, the Shopp team announced that the plugin was to undergo a full rewrite in an effort to stabilize the payment processing and other bugs that had been reported in the forums. As it stands, Shopp is in 1.1 beta and looks to be continuing progress.
As I was shopping alternative carts, a Google search brought me to another commercial e-commerce plugin I hadn’t heard of before: PHPurchase. It took all of two seconds for me to realize that something stood out about this plugin. Beyond it being hot off the press, it bragged of such features as PCI compliance and the ability to pass the McAfee Security Test. I liked that. As I dug deeper I took a few minutes to research PHPoet, the company behind PHPurchase and continued to find bits and pieces that I liked.
As I looked around further, I noticed that PHPurchase took a partially different approach to e-commerce in WordPress. Instead of auto-generating product grids and product detail pages, PHPurchase takes care of product entry and the other details surrounding the cart setup, and then leaves it up to you to populate your site.
To be more precise, PHPurchase lets you enter all of your payment gateway details, enter products into the products database, as well as customize a number of additional (and expected) options when it comes to e-commerce. It leaves it up to you, though, to populate the shopping area of your site. Instead of template-based shopping pages, PHPurchase offers a product entry button in the WYSIWYG editor that injects a shortcode which, when processed, outputs a price, quantity field, and a buy button. The rest is completely up to you.
It’s more work, but it’s more custom
That was the driving point for me with PHPurchase. Instead of accommodating a template structure of the cart plugin itself, I could go about my day and code a theme template file as though I were doing that for any other page on the site. On top of that, each and every other plugin I’ve come to know and love (e.g. All in One SEO Pack) would work like a charm, out of the box. PHPurchase was scoring major points the more I thought about it.
All of this took place as we were catching a more public wind about WordPress’ Custom Post Types. Custom Post Types are a flagship when it comes to evaluating WordPress as a CMS vs. a blogging engine. Here’s where my mind started racing. The combination of Custom Post Types and PHPurchase is game changing when it comes to WordPress based e-commerce.
Before Custom Post Types, product pages would be set up as any WordPress Page tree would. You’d create your Pages, populate your content, insert your shortcodes, and end up with a fully functioning e-commerce solution; fully integrated with your favorite plugins. Custom Post Types, though, give you the ability to custom tailor your data fields as well.
Custom Post Types allow you to populate your content as normal, but also give you the ability to set up custom taxonomies (e.g. product categories) as well as tags. You’re also able to custom code the theme file used for your Custom Post Types as though you were writing it for a built in WordPress Page. Instead of working with (or having to rewrite) product templates, you’re instead building your cart from the ground up with PHPurchase.
Without a doubt, it’s more work to get a populated cart up and running with PHPurchase compared to a templated e-commerce plugin. When I think about it though, I build WordPress themes from the ground up for every client (aside from a “new site” framework) and I do that because I believe in hand crafted websites. Why should a cart be any different? I think we’ve been in part complacent to the current cart solutions out there and I’m glad PHPurchase has changed the game for me. My clients will love it too.
Implementing PHPurchase with Custom Post Types
Part 2 of this two part series will consist of a walkthrough outlining how I work with WordPress, Custom Post Types, PHPurchase, and a number of plugins that will help make your cart stand out from the rest.