There are often times when you want to offer free shipping on subscription orders in WooCommerce as an incentive while continuing to charge for shipping on individual orders. In this tutorial, I will show you how to do this using a combination of WooCommerce Subscriptions, All Products for WooCoomerce Subscriptions and the WooCommerce Conditional Shipping and Payments plugins.
If you are more of a visual learner, feel free to watch this video:
Table of Contents
In order to offer free shipping on subscription orders while still charging for shipping on individual orders, we will need to install and set up three plugins. WooCommerce Subscriptions provides the ability to offer subscriptions to your products and services, while All Products for WooCoomerce Subscriptions adds to this by allowing you to offer both subscriptions and one-time purchases of your products and services. Finally, WooCommerce Conditional Shipping and Payments lets you set conditions for shipping costs.
Note: If you would like to learn more about setting up All Products for WooCoomerce Subscriptions, take a look at this video:
After we install and set up WooCommerce Conditional Shipping and Payments, we will test whether it works by applying it to this product:
1. Install and Set Up WooCommerce Conditional Shipping and Payments
The first thing that you need to do (after installing and setting up WooCommerce Subscriptions and All Products for WooCoomerce Subscriptions) is purchase and download WooCommerce Conditional Shipping and Payments. Afterward, you install it by first clicking Plugins from the WordPress Dashboard. Then, click Add New before clicking Upload Plugin. Finally, click Choose File and select the file that you previously downloaded, and afterward activate the plugin on the Plugin page.
To set up the plugin, first select WooCommerce > Settings from the Dashboard and click on the Restrictions tab.
Next, scroll down to the Restrictions section and edit Hide flat rate for subscription orders:
In the Short Description, enter Hide Flat Rate Shipping Method for Subscription Orders. Then, remove weekly as an option on the far right of Product on Subscription, as we only want to offer free shipping on monthly orders.
Next, click Save Changes, and then add another restriction by clicking Add Restriction.
Here we will hide free shipping for individual orders. In the Short Description, enter Hide Free Shipping for One-Time Orders, and in Exclude Methods, select Hide All “Free Shipping” Method Instances, Then, from the Add Condition dropdown list, select Product on Subscription. From the dropdown list next to it, select not all package items, and from the dropdown list next to it, select monthly.
Finally, click Save Changes, and we will now have our two restrictions set up:
2. Test Whether It All Works
First, we’ll go back to our coffee product:
Here select One-time purchase and click Add to cart. On the Cart page, you will see that it’s showing a flat-rate shipping fee:
But if we change the Price to $20 every 2 months and click Update cart, you will see that free shipping has been enabled:
But what happens when we have both a one-time purchase and a subscription in our cart?
To test this, we’ll first return our coffee product to a one-time purchase and then add a coffee grinder as a one-time purchase:
If we then go back to the Cart page, you’ll see that we have both products there as one-time purchases, with flat-rate shipping:
Even if we change our coffee back to a subscription, you will see flat-rate shipping, as we restricted free shipping to only if all items in the cart are subscriptions:
However, if we change our coffee grinder to a payment plan, we again will enable free shipping:
But what if you wanted to offer free shipping on any order that had a subscription product, regardless of whether they also had one-time purchases in the cart as well? To do this, first we’ll return our coffee grinder back to a one-time purchase and revisit our conditional shipping restrictions.
In restriction #1 Hide Flat Rate Shipping Method for Subscription Orders, we will change our Product on Subscription from all packages items to in package:
Then, in restriction #2 Hide Free Shipping for One-Time Orders, we will change our Product on Subscription from not all package items to not in package:
Finally, we will click Save changes.
Now when we return to our Cart page and refresh it, you will see that we have free shipping even though one of our products is a one-time purchase:
The WooCommerce Conditional Shipping and Payments plugin is very useful when you want to offer free shipping only on your subscription orders, and it couldn’t be easier to set up.