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:

Excluding multiple zip codes 05 Aug 2015 17:41 #1

  • 10287
  • 10287's Avatar Topic Author
Hi there,

I am currently setting up some rules for shipping, I am adding rules for UK excluding UK Highlands & Islands.

Below is what I am using for "IV" post codes and it does not seem to be working is there anything I am doing incorrectly?

Name=UK - Non highlands and islands; ZIP2 != "iv"; 0<=Weight<300;Shipping=3.80
Name=UK - Non highlands and islands; ZIP2 != "iv"; 300<=Weight<599;Shipping=4.20
Name=UK - Non highlands and islands; ZIP2 != "iv"; 600<=Weight<999;Shipping=4.80
Name=UK - Non highlands and islands; ZIP2 != "iv"; 1000<=Weight<1499;Shipping=5.50
Name=UK - Non highlands and islands; ZIP2 != "iv"; 1500<=Weight<1999;Shipping=6.50
Name=UK - Non highlands and islands; ZIP2 != "iv"; 2000<=Weight<2999;Shipping=7.50

Thanks !

--
Steve

Excluding multiple zip codes 07 Aug 2015 22:22 #2

Dear Steve,
The ZIP1, ZIP2, ZIP3, etc. are case-sensitive variables, so you would need to check "iv", "IV", "iV" an "Iv". On the other hand, the dedicated UK_Area variable (available only in the advanced version of the plugin) should always be UPPER-case, so the following rule should work in all cases:
Name=UK - Non highlands and islands; UK_Area != "IV"; 0<=Weight<300; Shipping=3.80

Best regards,
Reinhold

Excluding multiple zip codes 10 Aug 2015 11:03 #3

  • 10287
  • 10287's Avatar Topic Author
Thank you for your response!

I have made the changes to my previous syntax (i have the pro version). And the shipping method is still being shown for the UK areas that I specifically created a rule to not be shown. Although it is working the other way around, could be this be an issue with the current version of the plugin or some kind of conflict between rules?

The below is what I have entered in the text box:

Name=UK - Non highlands and islands; UK_Area != "IM"; 0<=Weight<300;Shipping=3.80
Name=UK - Non highlands and islands; UK_Area != "PO"; 0<=Weight<300;Shipping=3.80
Name=UK - Non highlands and islands; UK_Area != "IV"; 0<=Weight<300;Shipping=3.80
Name=UK - Non highlands and islands; UK_Area != "KW"; 0<=Weight<300;Shipping=3.80
Name=UK - Non highlands and islands; UK_Area != "BT"; 0<=Weight<300;Shipping=3.80
Name=UK - Non highlands and islands; UK_Area != "IM"; 300<=Weight<599;Shipping=4.20
Name=UK - Non highlands and islands; UK_Area != "PO"; 300<=Weight<599;Shipping=4.20
Name=UK - Non highlands and islands; UK_Area != "IV"; 300<=Weight<599;Shipping=4.20
Name=UK - Non highlands and islands; UK_Area != "KW"; 300<=Weight<599;Shipping=4.20
Name=UK - Non highlands and islands; UK_Area != "BT"; 300<=Weight<599;Shipping=4.20
Name=UK - Non highlands and islands; UK_Area != "IM"; 600<=Weight<999;Shipping=4.80
Name=UK - Non highlands and islands; UK_Area != "PO"; 600<=Weight<999;Shipping=4.80
Name=UK - Non highlands and islands; UK_Area != "IV"; 600<=Weight<999;Shipping=4.80
Name=UK - Non highlands and islands; UK_Area != "KW"; 600<=Weight<999;Shipping=4.80
Name=UK - Non highlands and islands; UK_Area != "BT"; 600<=Weight<999;Shipping=4.80
Name=UK - Non highlands and islands; UK_Area != "IM"; 1000<=Weight<1499;Shipping=5.50
Name=UK - Non highlands and islands; UK_Area != "PO"; 1000<=Weight<1499;Shipping=5.50
Name=UK - Non highlands and islands; UK_Area != "IV"; 1000<=Weight<1499;Shipping=5.50
Name=UK - Non highlands and islands; UK_Area != "KW"; 1000<=Weight<1499;Shipping=5.50
Name=UK - Non highlands and islands; UK_Area != "BT"; 1000<=Weight<1499;Shipping=5.50
Name=UK - Non highlands and islands; UK_Area != "IM"; 1500<=Weight<1999;Shipping=6.50
Name=UK - Non highlands and islands; UK_Area != "PO"; 1500<=Weight<1999;Shipping=6.50
Name=UK - Non highlands and islands; UK_Area != "IV"; 1500<=Weight<1999;Shipping=6.50
Name=UK - Non highlands and islands; UK_Area != "KW"; 1500<=Weight<1999;Shipping=6.50
Name=UK - Non highlands and islands; UK_Area != "BT"; 1500<=Weight<1999;Shipping=6.50
Name=UK - Non highlands and islands; UK_Area != "IM"; 2000<=Weight<2999;Shipping=7.50
Name=UK - Non highlands and islands; UK_Area != "PO"; 2000<=Weight<2999;Shipping=7.50
Name=UK - Non highlands and islands; UK_Area != "IV"; 2000<=Weight<2999;Shipping=7.50
Name=UK - Non highlands and islands; UK_Area != "KW"; 2000<=Weight<2999;Shipping=7.50
Name=UK - Non highlands and islands; UK_Area != "BT"; 2000<=Weight<2999;Shipping=7.50

Thanks

--
Steve

Excluding multiple zip codes 15 Aug 2015 14:45 #4

Dear Steve,
Thanks for posting the whole set of rules, which makes the picture much clearer. The problem is a small flow in your logic: With those rules, either the very first or the second rule will always match in any case (If UK_Area is "IM", then the first rule will not match, but the second rule will; If UK_Area is anything else, the first rule will already match).

Let's just rephrase your shipping costs in a way that can easier be implements correctly:
If the weight is below 300
AND
UK_Area is NOT in the list("IM", "PO", "IV", "KW" or "BT"),
THEN
shipping is 3,80

This can now be easily implemented as a rule (replacing all your five rules for each weight band):
Name=UK - Non highlands and islands; 0<=Weight<300; not(UK_Area in list("IM", "PO", "IV", "KW", "BT")); Shipping=3.80

Repeat the same for your other weights and you should be done.

Best regards,
Reinhold
  • Page:
  • 1