In my work as a WordPress developer, I spend a lot of time on e-commerce sites. These sites generally use either WooCommerce or Easy Digital Downloads, the most popular e-commerce plugins for WordPress.

The other thing I know about is PayPal, which has simple purchase buttons that I use on occasion.

The Limitations of WooCommerce, EDD, and PayPal

I personally love WooCommerce, but that doesn’t mean I’m blind to its potential drawbacks:

  1. Can definitely be overkill for simple transactions: it adds various pages, custom post types, and other structure to the site.
  2. No integrated payment gateway: PayPal is available by default, but full-featured gateways intended for credit cards must be integrated separately.

EDD is beautifully written by one of the best plugin developers out there, Pippin Williamson. Its obvious limit, though, is that it only handles downloads—not tangible, shippable products.

PayPal is, of course, a really well-known payment gateway. It’s fairly simple to use, but it has its own issues:

  1. Not terribly full-featured: you get the button with some potential dropdown options, and that’s it.
  2. Not all that easy to customize: the old-school code you paste in pretty much always looks and acts like a stock PayPal button unless you get really creative.

Snipcart, Eh?

I was intrigued to hear about Snipcart, whose value proposition—as best as I understand it—is “simpler, better e-commerce,” with an emphasis on minimal code and a minimal e-commerce backend.

Snipcart does seem to have a bit of a checkered history with WordPress, including a cancelled plugin. This isn’t that surprising, given WordPress’s unique ways of handling data: Snipcart works through HTML code paste-ins, and WordPress has too much going on under the hood to accommodate that easily.

So I thought I’d present the code for a simple WordPress integration in Snipcart. It’s short—around 50 lines of code—and dead-simple: it doesn’t add any admin pages, settings lists, etc., and you control it with a simple shortcode that you can drop anywhere in your posts, widgets, and pages.

#wordpress

Snipcart & WordPress: Shortcode-Based Integration - Snipcart
2.40 GEEK