The other day I received this question from a WooCommerce user:
I have virtual products in my store but I still want to collect the shipping information from my customers so that I can mail them a card at the end of the year. But a cart with virtual products automatically hides the shipping information on the checkout page. How can I force it to show up?
Just over a year ago I wrote a post which shows how to disable free shipping on a per product basis. That’s really useful for stores that like offering free shipping on just about everything everything and want to disable it one or two items. But what about people in the opposite situation? You might have one or two really tiny items like bookmarks don’t want to charge people $5 for flat rate shipping.
I figured it was time to revisit this and write a snippet that helps these people out. We can use the shipping classes built into WooCommerce combined with just a couple lines of code to make it really easy to mark any number of products eligible for free shipping.
One of the most complex parts about writing e-commerce software is creating shipping options that are configurable enough that people can create the shipping costs they want but the functionality isn’t too complex that people are confused. That’s why with WooCommerce we include Flat Rate Shipping because it’s perfect for people just getting started and isn’t so complex that you can’t launch your store.
If people want even more shipping options after having set up the rest of WooCommerce then it may be time to look at Table Rate Shipping. It is by far one of the most configurable extensions and it allows you create a table of shipping rates in hundreds of different combinations. You can create zones to target your shipping costs for a particular geographic region, you can group products by similar shipping sizes, you can use the product weight to determine costs, and you can create a table of rates where depending on where the order appears in the table determines the rate. Let’s jump in.
A few months ago I wrote a plugin that connects Spee-Dee Delivery, a shipping services for the upper midwest, and WooCommerce. The plugin is going through the audit process right now and should be launched shortly. While the whole process has taken a few months in terms of time writing code the project has only taken ~40 hours. About 20 of which have been doing QA testing to make sure it’s as intuitive as possible and doesn’t need to be done unless you’re planning on selling your plugin.
One of the things any good framework should do is provide utility functions. Things that make developing for that framework easier and consistent. For an e-commerce framework that would be things like rounding prices, calculating taxes, and getting shipping quotes. If you’ve ever wanted to dig into WooCommerce there’s a really easy guide to creating your own shipping method and I highly recommend you start there. It also happens to be a lot easier than building your own payment gateway. 🙂
One of the most powerful plugins for WooCommerce is Table Rate Shipping because it’s so configurable. You can create your own rules for bulk shipping, weight based shipping, or set up shipping zones and charge different rates for each zone. When someone requests their existing shipping method only support certain zones, or charge extra for specific zones we usually point them to Table Rate Shipping because that extension can do just about anything.
It would be nice if we could take some of the functionality of that plugin out and apply it to other shipping methods (like UPS, FedEx, USPS, etc.) but at WooThemes we’re very aware of feature creep and if we added these other feature the existing shipping methods would be bloated to the point of being unusable. So without adding a whole bunch of options that most users don’t want the best way to do this is to write a snippet of code to do this.