Flexible Shipping plugin has a lot of useful features and allows setting up many complicated shipping scenarios. Unfortunately, sometimes it’s just not that simple. In this article, I’ll show you how to combine shipping classes in Flexible Shipping.
If you are reading this article, you are probably familiar with the Flexible Shipping plugin. Maybe you are looking for some solution for your shipping scenario or just want to know more about the plugin itself. Flexible Shipping is a useful table rate shipping plugin that allows you to set shipping costs based on weight, price, number of items, or product category.
How to combine shipping classes in Flexible Shipping?
Setting shipping costs based on shipping class is the most complex one. The main issue is that, if you set two shipping classes to one rule, it will be called only when products from BOTH shipping classes will be in the cart. In other words, if you add them both to one rule it won't work as one OR another, but one AND another. This makes it a little more complicated to set up shipping rules for different products and combinations of them.
Let me show you an example to make it more clear. If you set the rules like that:
This rule will be called only when products from BOTH shipping classes “A” and “B” will be in the cart. If it’s only one of them, it will cause the “No shipping method available” message on the checkout page.
The main rule for combining shipping classes correctly
To correctly combine shipping classes from the previous example, you should set a separate rule for each shipping class:
This will work perfectly for both shipping classes separately. But what if your customer will have products from both of the shipping classes in the cart? I'll show you how to set a shipping price in that situation. It can be a sum of both shipping costs or different values.
Shipping cost as a Sum of two shipping classes
In that case, the shipping cost will be calculated based on your Rules Calculation set-up. It can be the sum of the rules, the highest cost, or the lower cost.
In this example, if you set it as Sum, the shipping cost for combined shipping classes will be $20. The reason for that is, that both rules (for both shipping classes A and B) are called. Both have a $10 shipping price, so as a sum, you'll get $20.
Different shipping cost for combined shipping classes
You can also set the shipping cost for combined shipping classes as a different value. It’s much more complicated, but still possible with Flexible Shipping. To do that you have to follow these rules:
- Set a separate rule for each combination of the classes - it will ensure that all the combinations will be calculated correctly as you want.
- To every rule using two or more shipping classes enable Stop checkbox - This way other rules placed below, won’t be called and the shipping cost calculation will be correct. Remember to apply this rule to only the shipping classes that you are combining. If you have other shipping classes in the shipping method, they will have to be over that stopping rule. In other case, the might be not called.
- Put the rules in the right order. It’s like a reverse triangle - the most advanced rules (for more shipping classes) should be on the top - Shipping cost in Flexible Shipping plugin is calculated based on the rules in the order of their appearance. So the rules using the largest amount of shipping classes should be on the very top.
That’s enough of the theory. How to use it in your WooCommerce store and don’t make any mistakes in combining shipping classes in Flexible Shipping? Let’s go through a few examples of shipping scenarios.
Combining two shipping classes
First, something simple. For instance, let’s assume that shipping of product A costs $10. Product B is bigger, so shipping it costs $15. Shipping them together in one shipment costs $20.
To make it simpler, product A has a shipping class A, and product B has a shipping class B. It will be the same for all other examples and additional shipping classes. This solution will work only for shipping rules Based on None. You can use the shipping classes with other Based on options like weight and price, but it will work slightly differently. You can read more about it in our documentation.
Combining three shipping classes
For the second example let’s assume that shipping of product A costs $10. Product B is bigger, so shipping it costs $15. Shipping them together in one shipment costs $20. Shipping cost of product C costs $5, but shipping cost for combining it with product A or/and B will be without additional cost.
Combining shipping classes in Flexible Shipping plugin is a complex case, but with additional explanation, it gets much easier. I hope that this article will be helpful and solve common issues with setting your advanced shipping scenario. Remember that certainly, the most important rule from this article is if you set two shipping classes to one rule, it will be called only when products from both shipping classes will be in the cart.