It seems obvious that if your cart has no shippable items, you shouldn’t ask for shipping fields, right?
Well, sort of. The approach we currently take in WP eCommerce (though we could be dissuaded) is to always show all checkout fields on checkout. The reason for this is actually pretty simple. As a store owner, the more data you have on your customer, the better. Even though they may purchase something, at some point, that doesn’t require shipping – that’s nice information to have. Not just for you, but also for their future purchases that may include shippable items.
That being our rationale, I get the opposing perspective, and actually appreciate that it’s a better UX that would probably increase conversions. To that end, this is a good way to conditionally remove shipping fields from your checkout process in WP eCommerce if they aren’t necessary.
Note: This works really great if you’re running WP eCommerce 3.9 or later. It works really not great if you’re not.
Awesome work thanks!