Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Shipping by Rules for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • eliotrayner
  • eliotrayner's Avatar Topic Author
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

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

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

  • eliotrayner
  • eliotrayner's Avatar Topic Author
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

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

Problem solved.
  • Page:
  • 1