VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Exclude Countries from Rule

Exclude Countries from Rule 05 Jul 2017 12:53 #1

Hi Reinhold,

Hope everything good with you.

I have a rule which should be for All Countries except UK, Jersey and Guernsey. At the moment I have to select all Countries then remove the UK, Jersey and Guernsey.

Would it be an idea to have an Exclude or Include field to go along with the countries selection?

regards
Eliot
The administrator has disabled public write access.

Exclude Countries from Rule 08 Jul 2017 18:18 #2

Dear Eliot,
To exclude certain countries there are already some approaches in place:
1) If you want to exclude them, because you have separate shipping costs in place, for which you already have rules: Simply use the first ruleset / country zone for UK, Jersey and Guernsey and make sure that all orders are really handled there (to be on the safe side, you can add a fall-through/catch-all rule of "NoShipping" at the very end of the first ruleset). All orders from these countries will then always be handled by the first ruleset and the second ruleset will never even be considered. You don't need any additional country exclusino in the second ruleset.

2) Country checks do not neccessarily use the country selection box. You can also check the country explicitly in a rule using the country or country2 variable. To exclude UK, Jersey and Guernsey, simply prepend one of the following to your ruleset (notice that I couldn'f find Guernsey in the country list, but I guess you should easily be able to expand the rule to cover Guernsey in your setup, too):

Free version (i.e. no list and no mathematical expressions):
country2=="GB"; NoShipping
country2=="JE"; NoShipping
Advanced version:
country2 in list("GB", "JE"); NoShipping
All subsequent rules of the ruleset / method will not be considered for United kingdom and Jersey orders.

3. If you want to exclude those countries only from one particular rule, then you can add the additional condition
not(country in list("GB", "JE"));
in your rule to exclude orders from United kingdom and Jersey for only that rule. UK and Jersey orders will be considered for all subsequent rule, as the rule does not match for UK and Jersey, and evaluation is only stopped if a matching rule gives NoShipping.

I think there are more than enough approaches to exclude certain countries, so I don't see the need to bloat the UI with an additional country exclusion box.

Best regards,
Reinhold
The administrator has disabled public write access.

Exclude Countries from Rule 08 Jul 2017 19:47 #3

Hi Reinhold,

Thanks for the excellent support. I had forgotten about using the country2 not in list. You're right no need to add to UI.

Regards
Eliot
The administrator has disabled public write access.

[SOLVED] Exclude Countries from Rule 15 Jul 2017 18:03 #4

Problem solved.
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular