If you landed on this page you’re probably using one of my ‘Advanced’ plugins. All the plugins where I use ‘Advanced’ in the plugin name allows you to use conditional logic to setup when something should happen. This blog post is here to help you understand how the conditions work and get things working to your needs.
Plugins using these conditional options
This is the current list of plugins that use the conditional logic to where this blog post applies to. It could be some newer ones won’t be listed (yet) if you’re reading this in the future.
WooCommerce
- Advanced Messages
- Advanced Pricing
- Advanced Shipping
- Extra Shipping Options
- Advanced Product Labels
- Advanced Shipping Validation
- Advanced Free Shipping
- Advanced Fees
- Advanced Shipping Packages
- Advanced Checkout Fields
Easy Digital Downloads
Available conditions
The available conditions depend on the plugin and what makes sense for it. I won’t be listing the conditions per plugin here, but with the plugins there’s a screenshot on their respective page showing the available conditions.
The conditions meta box
Lets really dive into the explanation of how things really work, starting with the conditions meta box.
This is the conditions area where all the conditions are listed in. This meta box is usually listed at the top of the page. The conditions in this meta box determine IF the action of the plugin should be applied. For example, for the Advanced Fees plugin it determines when a fee should be applied or not.
In order to have it apply the fee, ALL conditions in at least one condition group should be matched.
Condition groups
The conditions meta box can hold multiple condition groups. A condition group is the collection of one or multiple conditions in the grey boxed area as shown below.
All the conditions inside the same condition group are matched as ‘AND’. Condition groups themselves are matches as ‘OR’.
Adding a new condition group
Adding a new condition group can be done using the “Add ‘Or’ group’ button at the bottom of the conditions meta box.
Example
In the screenshot below the fee will be applied when;
– The ‘subtotal is less then $100’ AND is their ‘country is United States’
OR
– When their ‘subtotal is less then $200’ AND their ‘country is Canada’
Duplicating and deleting condition groups
When you over over a condition group, in the top right corner you’ll get see two action links: ‘Delete’ and ‘Duplicate’. Use these action to manage your condition groups more easily and quicker.
Adding conditions to a condition group
Use the ‘+ Add condition’ button at the bottom to add a new condition to that specific condition group.
Removing conditions
The ‘-‘ button on the right of a condition is used to remove a condition. Note that these will only be visible when you hover over a condition.
Conditions
A single condition consists out of three parts; the condition key, operator and value.
Condition key is a list of field you can choose to match against. For example the user role, country, subtotal, quantity etc.
Operator is how the condition will be matched, this can be ‘Equal to’, ‘Not equal to’, ‘Greater or equal to’, ‘Less or equal to’. Note that the latter two options include the value amount itself, so if you want to make ranges, make sure you do it like ‘1~10’, ‘10.01~20’, ‘20.01~30’ etc.
Value is a dropdown or text field where you enter the value you want to match against.
As noted earlier, all the conditions in a condition group are matched in a ‘AND’ fashion, this means all conditions in a condition group must match. This doesn’t mean that the conditions are combined together. The conditions are matched separately from one another.
For example, if you setup a ‘Quantity – greater or equal – 5’ condition and a ‘Contains category – equal to – A’ condition in one condition group, it does not mean that the cart should contain 5 products of category A. It means that the cart should contain a Category A product, and at least 5 quantity in total.
Question icon
Most conditions have a question mark icon to the right of it. When hovering over this a popup will show explaining how the selected condition works.
Custom conditions
It is possible to add your own custom conditions to the plugin. This does require some programming skills to do so.
If you’d like to hire me to create a custom condition for you, you can reach out to me through the contact form.
Feedback
Post a comment below if you have any improvements in mind for the conditions, or if something is missing in this post. You can also mail me directly through the contact form.
31 thoughts on “How the ‘Advanced’ plugin conditions work”
Thank you for the information.
My Scenario is a bit typical to me, but i believe it can help others too.
My country has 27 states and I can offer “Free Shipping” to only 5 of them.
My clientes also usually set a minimum subtotal to offer free shipping, let’s say $200
In your current AND / OR conditions I need to include the Subtotal + 22 conditions to remove the states I can’t offer free shiping to.
Is there any way to improve the plugin conditions to set AND / OR groups at will.
i.e.
Subtotal >= $200 (mandatory)
AND one of the following
State = RS
OR State = SC
OR State = PR
OR State = SP
OR State = RJ
That would fit my needs (and I believe others too)
Thanks in advance
Djio
Hi Djio,
You can configure the conditions also using the condition groups so that you only have to ‘whitelist’ the 5 states. The condition groups match in a ‘OR’ kind of way so that will work. You’d have to setup the subtotal condition in each condition group accordingly though.
Setting multiple ‘State’ – equal to – conditions in one group doesn’t work and probably will never work due to the conditions not being aware of one another, and all matching separately.
I’m thinking of other ways to select multiple states within one condition to allow for something like this to be setup more easily, but thats not a easy task either as there’s limit space to work with (so a simple multi-select as you see on the WC General settings isn’t possible)
Cheers,
Jeroen
Hi,
I want to add multiple zip codes for free shipping so can I add comma separated values or I need to add each zip code in separate conditions?
Regards,
Keyur
Hi Keyur,
The Zipcode condition allows for a comma separated list of values 😉
Cheers,
Jeroen
Hi Jeroen,
Thanks for this handy plugin! I is just what is needed for a webshop i am managing.
But when using a rule with ‘Shipping Class’ it seems the selected shipping class is not taken into account… When i use a specific product however it works fine.
Any ideas how this is possible? Thanks!
Regards >> henny
Hey there; I was a little confused around messaging. First I thought that your plugin does it on its own.
I THINK I now understand that I need to purchase Advanced Messaging here in order to have messaging. Can you confirm?
https://aceplugins.com/plugin/woocommerce-advanced-messages/
Hi David,
The Advanced Messages plugin is the only one that allows you to add messages on different locations. There are some other ‘Advanced ..’ plugins that adds some sort of message, e.g. Advanced Shipping Validation, but none other have special settings for it like Advanced Messages.
Cheers,
Jeroen
Hi,
We have free shipping by UPS Ground, but sometimes the customers want to pay for an expedited shipment. How do we provide this option?
Thanks!
Steve
Hi there
I need to set up 2 different options for free shipping. 1 is standard free shipping over $80 and 2 is Express DHL over $150. I have set it up but regardless of the amount only standard free shipping comes up.
Regards
Anthea
Hi Anthea,
You can use my Advanced Shipping to setup multiple shipping rates, all rates that match the conditions will appear on the front-end for the customer to choose from.
Is there anyway I am able to stop free shipping being enabled when a coupon giving a customer discount off products takes their subtotal below the limit set for free shipping? Apologies if I am missing something.
Yes, this is something that can be done with a custom condition. Feel free to reach out through the support channel for more information;
https://jeroensormani.com/woocommerce-advanced-shipping/support/
I want to offer Free Shipping when there is a quantity of a certain product. Example:
I have promotions 3 x 2 on my products, and I will allow free shipping if for certain product, they buy 2 of them.
I put 2 conditions on the group to test:
If contains product equal to Coffee 1 and the quantity of that product to 2, and the same for all products, i only have 3, how I can set that.
Hi Esteban,
For support questions on the plugin, could you please reach out through the appropriate support channel for that plugin.
Thank you,
Jeroen
Hi, Does this plugin enable the ability to show only local collection.
What I have – a list of shipping methods, one of which is collection only(for high valued items)
I need to hide the other shipping methods when Collection only is on a product in the basket.
Hi Lewis,
It is possible to setup a Advanced Shipping rate that only appears when a specific product (class) is in the cart. The ‘hide other rates when free is available’ setting can be used to hide other rates when this one is available.
Cheers,
Jeroen
Hi, Jeroen, how are you?
First of all, thank you for the great plugin!
I got a doubt which I think may help others as well.
It is about category of products in the cart. When we put the mouse over the question mark icon just right of the conditions it says “All products in cart must match the given category”.
So, we can make:
Greater or equal to 2 products of category A = free shipping
Greater or equal to 2 products of category B = free shipping
But how can I give free shipping for, lets say, customer buying:
Greater or equal to 1 product of category A + Greater or equal to 1 product of category B.
On this case, there are (at least) 2 products in the cart and they are from different categories.
Can you give me a light on this path, please?
Thank you very much.
Cheers from Brazil.
Hi Otavio,
The ‘Category’ condition indeed requires all products to have the given category. You can use the ‘Contains shipping class’ instead, which allows for others to be in the cart.
Alternatively it is possible to add a ‘Contains category’ as a custom condition.
Cheers,
Jeroen
Is there a way to offer free shipping when 2 ‘or’ conditions are valid?
Example: if group A is valid it offers free shipping, when group B is valid it offers free shipping, when groups A and B are valid, free shipping does not appear.
Hi Luis,
It would probably be possible to setup conditions in such manner that it doesn’t match for those groups, but its hard to confirm without actual example. Feel free to reach out through the support channel if you need assistance with a setup.
Cheers,
Jeroen
Hi Jeroen. Thanks for your plugin, it is really useful. But I have a small suggestion (or maybe you will have an alternative solution for me). I have configured a class based free shipping condition. So basically, if the cart contains a product that belongs to a class equal to xxx, the shipping is free. But it would be nice to be able to add the second condition that if the cart also contains a product that belongs to another class (for example yyyy) then there is no free shipping. So this is a double condition “Contains shipping class” + “Equal to” + “XXXX”. AND “Does not contain shipping class” + “Equal to” + “YYYY”. Thanks
Hi Sophie,
This can be done with the ‘Contains class – not equal – condition 😉
Cheers,
Jeroen
Hello, would it be possible to add several zip code ranges for example from zip code 86900000 up to 88100000 among other tracks?
Hi Fabio,
Yes, this would be possible.
Cheers,
Jeroen
Hi Jeroen,
I have an issue that I’ve been unable to solve for quite a while 🙁
I have a free shipping role under the WooCommerce > advance free shipping, and I set a minimum amount of 399 NIS to be considered as free shipping, but whenever there is a coupon i.e., a 10% discount, the goal is NOT to enable free shipping when subtotal after the coupon in case it’s not above the 399, so whatever happened there will not be free shipping if the subtotal is not above or equal to 399 NIS.
Hi Hila,
This can be done with a custom condition for ‘Subtotal minus discounts’ – it is not available out of the box through the plugin. Feel free to reach out through a contact form if you need help with this.
Cheers,
Jeroen
Hi Jeroen!
Hope find you well.
I am currently experiencing an issue with the Advanced Free Shipping Rate configuration on our website. Despite the conditions set, the system is incorrectly applying free shipping to certain postal codes.
Here are the details of the configuration:
Free Shipping Rate Name: Free Shipping Offer (190€)
Conditions to Enable Free Shipping:
Subtotal: Greater or equal to 190
Country: Equal to Portugal
Shipping Zone: Not equal to 4
However, we have a Shipping Zone 4 which includes the country Portugal and postal codes ranging from 9000-000 to 9999-999. According to the conditions, free shipping should not apply to this zone. Despite this, when I input a postal code from Zone 4 in the shopping cart, it still offers free shipping.
Could you please help me resolve this issue?
Hi Pedro,
The Advanced Free Shipping plugin does not natively support using zones, so unsure how you setup that condition.
Also make sure to check if the zone is configured correctly. Using a dash indicates a range between the two numbers; you should remove it if you wish to indicate a single zipcode.
Cheers,
Jeroen
Hi Jeroen, is it possible that plugin is not working for current wp version 6.6.1?
Hi Natalia,
All my plugins work with the latest versions of WP. I’d recommend to reach out through the appropriate support channel if you need help.
Cheers,
Jeroen