WordPress Custom Post Types & PHPurchase: Best Cart Ever – Part 2

Posted: August 09, 2010 Comments(52)

If you haven’t read part 1 I took some time to outline why I feel that the combination of PHPurchase and Custom Post Types can result in the best e-commerce solution for WordPress.

In part 1 I examined the current WordPress cart plugin landscape and outlined a number of reasons I feel that PHPurchase is currently the leading solution for an e-commerce solution, especially with the arrival of Custom Post Types. I’d like to share how and why using Custom Post Types works so well for a WordPress shopping cart.

Setting up and prepping WordPress

The first step will be to get your WordPress 3.0+ install up and running. That’s the extent of detail we’ll cover there. The next step will be to obtain and install a copy of PHPurchase. There are a number of purchase options available, but this walkthrough will cover functionality available under all licenses of PHPurchase.

The installation of PHPurchase is as straightforward as any other plugin. Once you’ve uploaded the plugin files and activated the plugin, you’ll need to enter your PHPurchase order number on the Settings screen:

Screenshot: PHPurchase settings

After validating your order number, the reminder to do so will disappear and you’ll be able to enter in your PayPal, Authorize.net, or Quantum Gateway payment settings. These details aren’t required at this point, but until that information is entered, the plugin won’t let you check out. For now, those are the only details we’ll cover as far as setup is concerned. Using the PHPurchase menu in the WordPress admin, you can begin adding products.

Screenshot: Adding a product to PHPurchase

Screenshot: PHPurchase product listing

As it stands PHPurchase will automatically implement a number of system Pages it will use to handle the cart view and checkout process for purchases.

Screenshot: PHPurchase default Pages

While these pages are an extremely important part of the overall e-commerce implementation, none of the products we just added are made available out of the box.

Screenshot: No products displayed in the WordPress theme

By editing the Store page, you can quickly add a number of products using the PHPurchase icon in the editor toolbar:

Screenshot: Adding a product via PHPurchase, step 1

Screenshot: Adding a product via PHPurchase, step 2

Screenshot: Adding a product via PHPurchase, step 3

Screenshot: Product visible on Store page

At this point, you can feel to proceed as normal. Using this Store page you could add every product you have available as well as apply some style and content using imagery, product copy, and links to relevant information. You could take it a step further and also create child pages with the Store as the parent and dedicate a product detail page to each of your products.

While helpful, you’ll quickly discover missing features that are very commonly found in other e-commerce platforms. Features such as browsing products by category and providing additional information about products in the form of multiple product shots and/or PDF downloads aren’t directly built into PHPurchase. The beauty lies in the fact that you can customize WordPress in all the usual ways to add these features as you see fit.

With the arrival of WordPress 3.0, however, there is an entire layer of additional functionality found in Custom Post Types that makes working with these features a breeze.

Using Custom Post Types for your PHPurchase Store

Custom Post Types are sometimes intimidating to more novice developers. Out of the box in WordPress 3.0 you need to manually register and set up your Custom Post Types. As with many developer-heavy tasks at hand, there is a plugin to make life easier when it comes to Custom Post Types; Custom Post Type UI.

Custom Post Type UI gives WordPress admins the ability to create, edit, and manage all of the Custom Post Types available within the WordPress Install:

Screenshot: Adding a Custom Post via Custom Post Type UI

Using the plugin you can easily create a Custom Post Type to handle all of your product pages in PHPurchase. You’re able to customize the phrasing used throughout and viewing the Advanced Label Options gives you even more to work with. On top of these Custom Post Type Settings, you can also set up custom taxonomies which can be used in this specific case for a set of categories limited to your store products and separate from your Post categories.

Once you’ve created your Custom Post Type, a new menu item will be made available in the main navigation:

Screenshot: Custom Post Type Menu

Using the links available you can go ahead and set up your categories as well as add your products.

Screenshot: Adding a Custom Post Type product

Screenshot: Products added to the Custom Post Type

Once your products have been added to your Custom Post Type, you can view the page on the front end:

Screenshot: Product page on website

Integrating Custom Post Types into your Menu

Now that your products have been added, you’ll want to make browsing your products as easy as possible. There are a number of things you can do, the primary two being including links to your product pages within your site navigation and using your Custom Post Type taxonomy (product categories).

Menus were also a big addition to WordPress in 3.0 and the update comes in handy at this point in our PHPurchase setup. The Menus are smart enough to recognize your Product Pages and allow you to integrate them directly within your site navigation:

Screenshot: Menus main screen

Screenshot: Store navigation

Using the Menus you’re able to mix and match your Product Pages, your Product Categories, as well as your WordPress Pages themselves. You can custom build any structure you wish using the menus and the available entries. By default, linking to a Product Category will direct readers to pages resembling those of your other category pages, likely using category.php from your theme. You can customize this to any degree as you would normally when developing your custom WordPress theme.

Screenshot: Custom Store navigation

Integration with plugins

Another significant advantage to using Custom Post Types and PHPurchase to power your WordPress based e-commerce website is the direct integration with many of your favorite plugins. One of the downfalls to a number of other WordPress store plugins is a lack of attention to search engine optimization. When working with product pages powered by Custom Post Types you can continue to use the SEO plugin working to optimize the rest of your website.

Additionally, you’ll be able to use plugins that enhance your ability to make additional product assets available to readers. Plugins like Attachments will let you add multiple product images for use in a product image viewer, PDFs including additional product details, as well as any available product details that may exist.

Screenshot: Product page integration with plugins

This is just the beginning

These are just the basics of getting up and running with WordPress 3.0+, Custom Post Types, and PHPurchase in an effort to get the best possible e-commerce shop up and running quickly and easily. While it’s a bit more work to get a large volume of products added and available on your website, I really feel that PHPurchase is a great choice when considering available e-commerce solutions for WordPress.

Get my newsletter

Receive periodic updates right in the mail!

  • This field is for validation purposes and should be left unchanged.


  1. Interesting stuff, but isn’t it even more powerful to combine this plugin with PodsCMS instead of with Custom Post Types ?
    You can have even more custom fields, and query them in a lot of ways, make it sortable etc.. ?
    What is your point of view on this ?

  2. I definitely love Pods and while it may be a bit more powerful to use Pods for the page content itself, I’ve never written anything along the lines of a full cart before. PHPurchase was built by someone who knows a lot more about e-commerce than I do and that’s comforting to me. This is one of the cases where it’s my personal opinion that Custom Post Types are a better choice due to the outside circumstance of another plugin powering an important part of the process. On top of that, the above outlines the only custom fields I’d probably end up using as far as product pages are concerned, with All in One SEO and Attachments in the mix. Great question!

    On the other hand, however, there’s nothing stopping you from using PHPurchase in tandem with Pods, that’s an absolute possibility.

  3. Great write up! I had to deal with e-commerce lately but they had a store using Magento and wanted to integrate it into their website which was build on WP. As of right now there’s no real satisfaying way to do this so I just had to build a template for Magento to match the website (which isn’t that user friendly if you’re not used to the Magento system). I would love them to switch over to something that integrates easier and better with WordPress also so they could start to take care of it themselves (which they never had before for their website and now finally can do using WP). So I might take a closer look at this one on my dev install.

  4. Hey Jonathan nice writeup and thanks for the rough introduction of PHPurchase. As per my tweet, I need to dive into that plugin as it looks pretty dang nice. Ecommerce is always the suck and anyway to make that easier and less obtrusive and more integrated with WP is quite alright in my book.

    I’m a heavy user of Gravity Forms and I like that they integrate directly with that, and the way they seem to have handled the membership management is great too… Enough about them tho I could go on lol…

    I may look at using that for any upcoming ecomm projects, which I normally avoid. Perhaps I may use this for event ticketing for WordCamp Phoenix 🙂

    Thanks again man

  5. Great timing! I’m just about to start researching different WordPress e-commerce options for a new client, and already this one is looking very promising. The ability to choose whatever structure I prefer (posts, pages or custom posts) for listing my products, rather than being tied into something the plugin authors have chosen, is very appealing indeed.

    I can see this plugin becoming popular with developers because of that flexibility, while non-technical end-users are maybe more likely to be attracted to Shopp or others that do everything for you.

    You don’t mention the backend shop/order management much – how did you find that side of it?

  6. Can anybody think of a way to be able to import/export products and/or inventory using a setup like this?

    Also, is it necessary to insert the shortcode inti the product page inside of the WYSIWYG editor for things like the add to cart button? Or are these types of things able to be implemented as a part of the custom post template’s .php file?

  7. Is there any way to manage the products via a CSV import/export system? That would make this an amazing product. I’d also like to be able to have my client add their own products without having to add in the shortcode for the add to cart button for each of the products, is that possible? I don’t really have much experience using WordPress custom posts but WP E-Commerce has been terribly buggy in my testing.

    I also don’t want to have to try and recreate my theme for Magento in order to keep things looking the same on both sites. Theming Magento is really a challenge, but the features that it offers are really great. Plus, it doesn’t run too quickly unless I’m on a great host.

    Thanks for any insight.

  8. Hi Jonathan,

    I read through both of your posts on PHPurchase and actually just submitted a cancellation request with 3dcart, who I’d just signed up with. I have a very simple store that will only sell a few products, but each product will have several variations and options, much like a computer would.

    I have a question – let’s say that I wanted to include small images that showed ten different color options, so the users can actually see the color swatch. How would you suggest integrating that sort of functionality into a product page? If you look at http://www.beyondnice.com and look at one of their covers you’ll see all sorts of images that directly associate with the product variations – cover shape, size, color, etc. I want to show users these sorts of images much the same way. Any thoughts much appreciated…

  9. Hey Mike, glad you like the looks of PHPurchase. The great thing about the plugin is that you can use ‘regular’ WordPress plugins on your product display page. In your case I’d definitely recommend checking out Attachments which does precisely that. Best of luck with PHPurchase!

  10. Since we’re working with WordPress Posts, Pages, or Custom Post Types, it’s definitely possible to do such a thing, but you’d need to write your own script to ensure the content types were set up properly, imported properly, and imported with the right data. It’d be quite a lengthy process to be honest. You could also automate things like working with the shortcode during the import or set something up afterwards but again, it’d be a matter of something custom built on your behalf.

  11. The shortcode includes defined variables which link up to the proper prices and also tells PHPurchase what product was added to the cart itself, so the (accurate) shortcode is definitely required and I’d recommend sticking with that as it’s part of PHPurchases documented usage.

  12. For a client’s site that needs 1 product to sell via ecommerce (so very simple), I looked into and tested WP eCommerce but found their support and documentation horrible. Shopp seemed better on those counts and other counts, so I chose Shopp a few weeks ago and I have been fighting with Shopp ever since. I started before the 1.1.2 update, but updated to 1.1.2 (with a bunch of problems) and am now still fighting with it. So I then came across PHPurchase via a LinkedIn.com WP group discussion and the PHPurchase website lead me here. So now I’m sold on PHPurchase — to at least try it. In fact I am getting out the CC now to purchase it. I hope it’s as easy as advertised. Fingers crossed.

    Thanks for the detailed articles! very nice job.

  13. Hey Jonathan,

    Thanks for the review. I currently own the shopp plugin and the WP shopping cart by tribulant software. Bot have their ups and downs but I’m looking for that “go to ” plugin like you mentioned and I think I just might have to give PHPurchase a try.

    BTW, nice site, bookmarked.

    Thanks again,


  14. Hi Jonathan,

    What a fabulously detailed overview and review! Thanks for taking the time to talk about PHPurchase in so much detail – I’m definitely sold to the point of giving them $99 to try it out.



  15. Hi Jonathan,

    Thanks very much for this extensive review of PHPurchase. As with others who have posted here, I might be reading this review at the right time coz I’m looking for a shop solution for my photography site. I have looked at Magento (to run the site separate to the WP Photography site), WP eCommerce, WP eShop and Shopp, to name a few. They all have indeed their good and less good sides, but for me, what is important is to be able to add the shop inline to my Posts.

    So for example, I have made a Post of a picture, and I would like to offer this picture in various print form, like canvas or poster prints in various sizes, as a card or postcard, with gift messages etc.

    From the initial look at PHPurchase, I didn’t see very many custom options for variations. Is this where the Custom Post Types comes in?

    Another option I would need is a file upload option so that I could offer the print service to my visitors so they can upload their files for printing. Would this be possible with PHPurchase?

    Thanks again for the great review and looking forward to your reply, when you have a moment.


  16. I have Installed PHPurchase and have done all the setting shipping taxes and but in a product for testing. put when i go to edit store page the PHPurchase icon in the editor toolbar is not there??? has anyone had this problem. im using Version 3.0.1 wordpress

  17. Nice review!

    I dunno though… I feel as though WP eCommerce and Shopp work in a way that is more intuitive for the average person: product page, variation page, category page. The workflow for the shopkeeper makes sense.

    Working with the post editor and having to add shortcodes for store functions seems… clunky?

  18. You’re absolutely right, it’s way more clunky than a ‘traditional’ cart, but I’m thinking that’s what has me attracted to it the most. Many of the clients I work with are small shops, selling just a handful, maybe a few dozen products. PHPurchase lets me customize everything top to bottom super quickly (when compared to a traditional cart). That said, should a client project come up with hundreds or thousands of products, I’d totally go with Shopp. Great point!

  19. This article is exactly what I needed. After half a year of nightmares with WP-Ecommerce, and another month of pain with Shopp, I finally have a solution that simply WORKS. Your tutorial was a great help. Would you consider writing a part 3 that shows how to customise the store category pages? On the website I’m working on now, my thumbnail generator and image titles are working but some CSS is clearly not being applied as the spacing and alignment is not correct. Besides which, I’d like to have my products arranged in a different manner to that which my articles are sorted, such as a grid layout. Any tips?

    Thanks again for the above tutorial 🙂

  20. Okay, this is actually starting to get a little buggy. No matter what I do, only one item will show up in a taxonomy’s archive page. And the CSS around the content of the pages and summaries isn’t working either. What the crap!?

    Can you help?

  21. Edit: fixed the issue with only one item showing up by using a better custom posts plugin: GD Custom Posts And Taxonomies Tools. It allows quite a lot more control over custom posts 🙂 My CSS is still missing, but it’s a start ^^

  22. I like PHPurchase for its simplicity, but at the same time I find it misses important marketing functionality with discounts.

    You can assign discounts on the whole cart, but not on individual products. So, I can’t take $10 off a specific product, but I am able to take $10 (or a percentage) off the total amount. This matters a lot if I want to encourage the sales of specific products.

    There’s also no conditional discounting (ex: buy one, get one free).

    I’m not sure what other alternatives are out there to meet those needs, though.

  23. Jonathan, thanks for the write-up. Solid review.

    Do you know if it is possible to add weight changes to variations?

  24. Hi Thomas, unless you’re planning to somehow automate the product page creation, I probably wouldn’t recommend PHPurchase simply because of the man hours involved in setting up 40,000 Pages.

  25. Hi, I was looking online for a very custom solution and came across your post. Because what I am looking for is so unique let me first tell you what I want and I would love your input on what the best solution would be. Sounds like PHPurchase might do the trick, but there also may be another options.

    My requirements:
    1. I want a plugin for my wordpress blog, which functions like an ecommerce site (with products) but WITHOUT a checkout function. The reason that I don’t want a shopping cart is that I am part of a franchise and my franchise requires me to go through their checkout site (for a whole slew of reasons) so I would redirect them to my franchise’s checkout page. I am going to use my blog to talk about the menus and allow reviews and basically create interest in the menus while letting people order off my franchise’s site.
    2. There are two active menus at a time (current month and next month), each with 17 items that change monthly. Each menu is also split into four categories: Specials, Best of the Best, Classics, Fast Lane. So I would like to be able to have a template for “This months menu” and “Next months menu” each with 4 categories: Specials, Best of the Best, Classics, Fast Lane,and have the products/menu items under each subcategory. Some items repeat every few months, while others are available for that single month. For the ones that repeat I want to bring back the commentary etc when the return.
    3. I want to allow comments/reviews. Specifically, I want people to be able to rate (with stars) the overall rating of the menu item, how kid friendly the item is, how easy the item was to cook, and have a comment box for text input. I’d like this for every single menu item (much like those commentaries on items on sites like amazon/target).
    4. Ideally at some point I’d like to have a section (not urgent) for “If you liked X item you’ll also like this” or any sort of way of showing similar products to help people decide whether they would like a certain item or not.

    The reason I feel an ecommerce site is the best solution for me (as opposed to using a gallery or portfolio set up) is because some of my menu items repeat every few months and when a particular menu item repeats I want to be able make that item active again, place it under the right month and subcategory, and bring back all the previous comments and reviews. I am almost certain a gallery/portfolio setup would not be able to do this.

    On a monthly basis I would like the extent of my “hands-on” work with this part of my site to be 1. inputting all the new items/products and 2. updating the product numbers for the products that show display under “this months menu–>specials”, “this months menu–>best of the best”, etc etc.

    Thank you in advance for any input!

  26. I had a client purchase it and I’ve been in their forum, unanswered questions from 3-6 months ago, people complaining about that. The one response I saw was “we’re busy updating the plug-in so we don’t have time to support as much as we want.” Right now I feel it’s take your money and run. They advertise outstanding support, all I see is relatively no support. And the plugin has problems with shortcodes not working, etc. Not happy at all with it.

  27. just recently went through a world of trouble building a site using wp e-commerce… was about to build another site on it (was testing with WPEC 3.8 beta version) but just couldnt stand having to go through hackin’ and slashin’ code again.

    so i stumbled upon PHPurchase a week ago and started messing around with it. Was really happy about how unobtrusive it was to my themes.

    I stumbled across your article and was so relieved to find others doing the same thing, and making it work! Your tutorial is going to help me a lot as I work through this site.

    Thank you so much for writing this up… you are awesome.

  28. Cindy is right here. There are a lot of people and questions which are unanswered on the forum and there was mention that they are busy on version 3.

    I think PHPurchase does have potential, but at this moment, it doesn’t really live up to the expectation of being the best shopping cart solution and best support. They are responsive, but a lot of questions are still open on the forum, some for weeks and/or months indeed. There are a few basic things missing or options that some people would like to have and when this is brought up in the forum, it doesn’t mean critisism, but I think most of the people would like a constructive solution.

    It’s not like the guys don’t know PHP so they can’t give a solution. It seems like they answer when they want to.

    Another thing is that the plugin seems to cater more for the US market than it does for the rest of the world. I think there are many european users who also use the forum and their feedback, if understood well and responded to, will help make this a strong shopping cart contender.

    So it’s a promising and hopefully they will be more responsive when version 3 is out.


  29. Thanks for the great article – it made my decision a WHOLE lot easier. Works great – wish my theme was a little easier to deal with, but overall this rocks – running on WPMU 3.04.

  30. Thanks for this article and tips, however there is one thing I’m trying to figure out:

    What’s the best way to show the Add to Cart button on a product list page? Say you want to run a query that grabs all the products in a certain category. The only way I can figure out how to dynamically show the add-to cart button is to include the_content. Would you suggest using custom field with the cart66 shortcode in it?

  31. I would guess you could use the doShortcode() function for this, although you’d need to find a way to pass in the PHPurchase ID number, maybe through a custom field in the post.

  32. Jonathan, just wanted to say thanks for a great article. I’m new(er) to E-Commerce solutions and I’ve spent the last several months battling with WP E-Commerce sadly thinking it was the best product available. Happily, it looks like I was wrong!

    Looking forward to learning more about the product and following you on Twitter.

  33. Here is a question that I could not find an answer to on their site. If my client is set up with their bank with a merchant account and the server has a ssl certificate installed and active then what do I need a “gateway” for? Is Cart66 set up to be able to take CC purchases directly in this way or do I also need something else? Another plug in of some kind?

  34. SOLD! just picked up Cart66 based on this most excellent post…many thanks for the effort that went in to this informative overview!

  35. First up, thank you so much for this article! So thorough, and so very helpful!

    One bit of extra help I (and I’m sure others) could really use, if you could spare the time, was a bit more details about how you implemented a “product image viewer”.

    I’ve been checking out your plugin (Attachments), which looks awesome, but I am not a PHP/JS expert so I’m struggling to figure out how to implement a product image viewer with this plugin. I was thinking of using the code here but I’m not 100% sure how to make it work with Attachments or if is possible. So I thought if you could share how you did it, that would be awesome!! Thanks.

  36. I’m not familiar with the piece to which you linked, but Attachments was designed to be used from the lowest level for integration as the author saw fit. I’d say check out the documentation for Attachments as well as the image viewer you mentioned and give it a whirl!

  37. Hi Jonathan. I appreciate your article on the custom post types and shopping carts. Very well written and actually exciting to think that it could work.

    My client wants to have a “quote basket” function where there is no financial checkout, just a request to get information on a specific product or number products. I’ll import the products from a remote inventory system in the Wp database and I have built custom post types (using types and views – http://wp-types.com/) and now want to integrate the products into the shopping cart function for the quote basket.

    I own PHPurchase and I am concerned about whether the imported inventory can be placed on pages that are built dynamically, based on the custom post types. It sounds like I might be in trouble. Any opinion on my approach?

Leave a Reply

Your email address will not be published. Required fields are marked *