Cash on Delivery in WooCommerce is a one of its basic payment options. It works great with the flat rate, but if you are using table rate shipping plugins the flat rate might be simply not enough. In this article, I’ll show you how to use WooCommerce COD together with Flexible Shipping plugin.
Cash on Delivery (or simply COD) is a very useful payment method. It allows your clients to pay for a product when they receive it from the courier. The basic functionality of this feature is available in WooCommerce. You can get all the information about it in WooCommerce documentation. However, what if you want to offer COD payment for more advanced and non-WooCommerce-in-built shipping methods?
Table Rate Shipping and Cash on Delivery
If you are using table rate shipping plugins, like Flexible Shipping, the basic COD might be not enough. You may encounter some difficulties or compatibility problems with the shipping methods coming from the 3rd party plugins, especially if they use the shipping cost calculation rules for specific shipping classes. But guess what - our Flexible Shipping plugin is fully compatible with the WooCommerce COD since it uses the same default WooCommerce shipping mechanisms. You will learn from this guide how to set everything up in two different ways - using Flexible Shipping PRO combined with WooCommerce COD and I will show you even more powerful combination with Active Payments payment management plugin.
How to set Cash on Delivery in WooCommerce for specific products?
As I mentioned before there are two different ways how it can be achieved, however, both of them involve using the Flexible Shipping PRO plugin.
In case you haven't heard about it yet, Flexible Shipping is a very popular table rate shipping plugin with more than 100,000 shops using it on a daily basis. In the PRO version, it allows to set the shipping rules based on shipping class, which will be crucial in this case.
Since both scenarios require using the Flexible Shipping plugin let's begin and ...
Add Flexible Shipping method
First, add a new shipping method, that will be enabled only for certain products or product categories. It’s all based on the shipping class. To do that, go to WooCommerce → Settings → Shipping and then to your Shipping Zone. There click on Add new shipping method button.
Next, choose Flexible Shipping as a shipping method and click Add shipping method.
As you can see it's enabled by default just after it's created. Click on the new Flexible Shipping method's title:
to reach its configuration screen:
Enter its name by filling in the Method Title field. For the purposes of this guide I named it Fixed price for pizza. Next, scroll down in order to...
Add shipping rules for Woocommerce COD method
In the rules table at the bottom of the screen create a new rule using the Add rule button. Set:
- When: Shipping Class
- cart contains: Pizza
- rule cost is: $10
Selecting the shipping class here is the most important action you need to take here since we want to target and display this shipping method only for products from the chosen shipping class.
In my example, it’s $10 for shipping products from the Pizza shipping class.
Once the Flexible Shipping method is configured and all the changes saved, we've reached the point where the road splits and we need to...
Select the payment option - WooCommerce COD
As I previously mentioned, Flexible Shipping is a table rate shipping plugin which methods use the same core mechanisms as WooCommerce defaults. In other words, they are fully compatible with WooCommerce COD, so you don't need to be afraid they won't be recognized or you'll encounter any other issues. That's why if you choose this scenario the only thing left now it to point the Flexible Shipping method you've created to be handled by WooCommerce COD payment method.
To do that go to WooCommerce → Settings → Payments. In the available payment methods table click on Cash on Delivery. On its configuration screen select the Flexible Shipping method you've created in the Enable for shipping methods field and save the changes:
If, in turn, you decided to use the second scenario i.e. ...
Cash on Delivery in WooCommerce using Active Payments plugin
which offers much more flexibility and gives you the possibility to include e.g. some additional fees, start with turning the Active Payments plugin on. Once it's enabled go to WooCommerce → Active Payments. You should see all your configured shipping methods and active payment options there:
Using the checkboxes select which payment options should be available for each shipping method. In my case, it’s Cash on Delivery and PayPal for Fixed price for pizza shipping method dedicated for products with Pizza shipping class and PayPal for Standard shipping (other products).
Please note that you can also define the additional fees for each payment method in the Fees tab:
Having all set now, let's see how it works live in my shop.
Cash on Delivery in Woocommerce for specific products - results
When the customer adds to the cart a product with Pizza shipping class he will see only the Fixed price for pizza Flexible Shipping method and both, the WooCommerce COD and PayPal payment methods will be available to choose:
However, if he puts a different product without Pizza shipping class into the cart the Standard shipping method appears and there is only PayPal payment gateway available to choose:
In this article, you learned a lot about conditional Cash on Delivery in WooCommerce. Also, I showed you how to set Cash on Delivery for specific products in WooCommerce. Now it's all up to you. I hope it will be helpful. Good luck!