Automated WooCommerce Testing with Ghost Inspector

WooCommerce sites are made up of a complex set of integrated parts. There’s WordPress, WooCommerce itself, other third-party plugins, and a theme. Each of these components require frequent updates and has the potential to break critical functionality on your site. This is why it’s critical to have automated tests.

For a WooCommerce site I used to work with, we had a checklist of items we would manually run through after any major update:

  • Verify products on home page look correct and load
  • Test “Add to Cart” button
  • Test removing item from cart
  • Verify all product on /shop page look correct
  • Test complete checkout with Stripe for guest checkout
  • Test complete checkout with PayPal for guest checkout
  • Test complete checkout with Stripe with coupon for guest checkout
  • etc.

Needless to say, this took a lot of time. Thankfully, tests like this can all be automated using Ghost Inspector.

Continue reading

Subscription Toggle in WooCommerce

In WooCommerce subscription products and standard products can’t be combined. For example, if you’d like to offer customers the option to purchase coffee as a one-time sale or as a convenient monthly subscription, you’ll need to create two separate products on the backend (even though it’s essentially the same product and SKU).

If you’re SEO focused, this might be a concern in terms of duplicate content and splitting page rank. For customers, this also isn’t a great experience. If a customer lands on the one-time product page, they might not know about the subscription option (and vicea versa).

A better example of subscription user experience is Target. If a product offers a subscription option, there’s a radio button toggle with a discount clearly highlighted. Turns out, with a little work, this is also possible to do in WooCommerce. Continue reading

Shopify vs. WooCommerce

A former client contacted me this week because they were thinking about switching platforms for their ecommerce store. The site had originally been built on WooCommerce but they were now considering a switch to Shopify. The main issue is they didn’t want to have to rely on a developer for site updates and wanted a solution they could more easily manage themselves.

To answer their questions, I signed up for a Shopify account and then went through the technical and business requirements one by one. If you’re trying to decide between Shopify and WooCommerce, hopefully some of these notes are useful.

Continue reading

Unit Tests for WooCommerce Extensions

I am completely new to PHP unit testing, but I decided it was time to learn after discovering a critical bug in a small WooCommerce extension I had built for a client.

The extension I built added a feature that allowed administrators to limit specific coupons to new customers only. I had done some manual testing and made sure that new customers could use the coupon and existing customers could not. But there was a logic bug I missed that prevented existing customers from using any coupons, even ones that did not have the “new customer” restriction.

After finding the bug, I knew there were several use cases I would need to check every time an update was made to the plugin:

  • New customer should be able to apply a coupon
  • New customer should be able to apply a coupon with a “new customer” restriction
  • Existing customer should be able to apply a coupon without a “new customer” restriction
  • Existing customer should *not* be able to apply a coupon with the “new customer” restriction

Obviously, checking this manually each time would be rather tedious- which is why I turned to unit tests.

Continue reading

Thoughts on Theme Options

One of the most difficult decisions I face when building a new theme is which customization options to include.

It’s an incredibly difficult feature to balance. Customization options can make it possible for a single theme to be used for a greater variety of websites (which is good from a sales perspective), but it can also make a theme more complex to set up and customize.

Many of the best-selling commercial WordPress themes are ones that allow non-developers a huge amount of customization choices. Avada, Canvas, Divi, Make, Total and X Theme all have hundreds of settings. The big website platforms like Squarespace and Wix also provide a huge amount of design control.

Options Are Both Popular and Complex

I understand why customization is important. One of the main purposes of a website is to express a brand or identity. Customization of fonts and colors can be hugely important. When I helped my wife set up her first WordPress site years ago, I installed Canvas by WooThemes because I knew she’d want something that could be altered to fit her specific design aesthetic (and I didn’t have time at the time to customize it for her).

But even with a thousand options, there’s no way that everything can be customized. And adding many options has a downside: it increases the complexity of the user interface and code. Continue reading

Zelda Released, Zenith Retired

Zenith was the best selling theme on DevPress, so it may seem like an odd move to retire it. However, we’re introducing a new theme today called Zelda designed to take its place.

zelda

Everyone who has an active license for Zenith now has access to Zelda if you’d like to switch. You can also choose to stay with Zenith if you’re happy with it (DevPress will continue support for a year and release updates as needed). Continue reading