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:

shipping by UK postcode 16 Sep 2013 11:28 #1

  • aarondurber007
  • aarondurber007's Avatar Topic Author
hi

i have Joomla 2.5.11 and the Advanced Shipping by Rules Plugin for VirtueMart 2

i am having difficulty getting the postcode area bit to work

for example if i wanted a certain price for weight and region of ST1 to ST5 ranges of post code i am using

Name=Qtr Pallet; UK_Area=="ST" AND 5<=UK_District; 151<=weight<=250; shipping=47

this does not seem to work

i have the whole of the uk to do split into 8 zones and 5 different weights, eg

Name=UK; Weight<=20; Shipping=6.00
Name=UK heavy; 20<=weight<=150; shipping=(articles*15-20)*0.2+6

Name=Qtr Pallet; UK_Area=="ST"; 150<=weight<=250; shipping=20
Name=1/2 Pallet; UK_Area=="ST"; 251<=weight<=500; shipping=22
Name=Full Pallet; UK_Area=="ST"; 501<=weight<=1000; shipping=25
Name=Qtr Pallet; UK_Area=="ST" AND 5<=UK_District; 151<=weight<=250; shipping=47


below is as far i have got - it all works except the postcode range. i have tried just the postcode range on its own and it will not work.


Name=UK; Weight<=20; Shipping=6.00
Name=UK heavy; 20<=weight<=150; shipping=(articles*15-20)*0.2+6

Name=Qtr Pallet; UK_Area=="SK"; 150<=weight<=250; shipping=20
Name=1/2 Pallet; UK_Area=="SK"; 251<=weight<=500; shipping=22
Name=Full Pallet; UK_Area=="SK"; 501<=weight<=1000; shipping=25

each of the below has to have a qtr, 1/2 and full pallet added to each area and some have post code ranges

Name=Qtr Pallet; UK_Area=="BL"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="CW"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="M"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="OL"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="WA"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="WN"; 150<=weight<=250; shipping=20

Name=Qtr Pallet; UK_Area=="SK"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="AL"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="B"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="BA"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="BB"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="BD"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="BS"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="CB"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="CH"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="CV"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="DE"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="DN"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="DY"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="GL"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="GU"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="HD"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="HP"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="HR"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="HX"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="L"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="LE"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="LS"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="LU"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="MK"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="NG"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="NN"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="OX"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="PE"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="PR"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="RG"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="RH"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="S"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="SG"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="SL"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="SN"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="ST"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="TF"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="WD"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="WF"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="WR"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="WS"; 150<=weight<=250; shipping=33
Name=Qtr Pallet; UK_Area=="WV"; 150<=weight<=250; shipping=33

Name=Qtr Pallet; UK_Area=="PO"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="BH"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="BN"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="CF"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="CM"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="CO"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="DH"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="DL"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="DT"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="FY"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="HG"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="HU"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="IP"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="LA"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="LN"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="ME"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="NE"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="NP"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="NR"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="SO"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="SP"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="SR"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="SS"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="TA"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="TS"; 150<=weight<=250; shipping=34
Name=Qtr Pallet; UK_Area=="YO"; 150<=weight<=250; shipping=34

Name=Qtr Pallet; UK_Area=="CA"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="CT"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="EX"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="LD"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="LL"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="PL"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="SA"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="SY"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="TN"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="TQ"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="TR"; 150<=weight<=250; shipping=47

Name=Qtr Pallet; UK_Area=="EC"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="wc"; 150<=weight<=250; shipping=47

Name=Qtr Pallet; UK_Area=="BR"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="CR"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="DA"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="EN"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="HA"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="IG"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="KT"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="RM"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="SM"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="TW"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="UB"; 150<=weight<=250; shipping=47

Name=Qtr Pallet; UK_Area=="EH"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="G"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="FK"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="ML"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="KA"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="KY"; 150<=weight<=250; shipping=47

Name=Qtr Pallet; UK_Area=="AB"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="DD"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="DG"; 150<=weight<=250; shipping=47
Name=Qtr Pallet; UK_Area=="TD"; 150<=weight<=250; shipping=47


Name=Qtr Pallet; UK_Area=="SK" AND 5<=UK_District; 150<=weight<=250; shipping=47

all help is much appreciated.

shipping by UK postcode 17 Sep 2013 01:55 #2

Hi Aaron,

hi
for example if i wanted a certain price for weight and region of ST1 to ST5 ranges of post code i am using

Name=Qtr Pallet; UK_Area=="ST" AND 5<=UK_District; 151<=weight<=250; shipping=47

this does not seem to work


Do I understand you correctly that the rule WILL match and be applied when you leave out the UK_District check? In particular, one frequent problem is that the weight is set to wrong units and so the weight condition is not fulfilled.

But if we can rule this cause out, then we can really concentrate on the UK_District.

Name=Qtr Pallet; UK_Area=="ST"; 150<=weight<=250; shipping=20
Name=1/2 Pallet; UK_Area=="ST"; 251<=weight<=500; shipping=22
Name=Full Pallet; UK_Area=="ST"; 501<=weight<=1000; shipping=25
Name=Qtr Pallet; UK_Area=="ST" AND 5<=UK_District; 151<=weight<=250; shipping=47

below is as far i have got - it all works except the postcode range. i have tried just the postcode range on its own and it will not work.


What is always a nice approach to debugging such problems is to include {uk_district} in the name of a rule that is matched. Everything of the form {variable} in the rule will be replaced by the variables value.
In your case, I would try a rule with no conditions so that we are sure it matches and really prints the name in the list of offered shipping methods:
Name=Test rule, UK_district={uk_district}; Shipping=20

That should give you an idea whether the uk_district variable has the proper value (and the check still fails) or whether is has not any value assigned at all (e.g. because the postal code does not have the form of a UK postcode).

Name=Qtr Pallet; UK_Area=="BL"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="CW"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="M"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="OL"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="WA"; 150<=weight<=250; shipping=20
Name=Qtr Pallet; UK_Area=="WN"; 150<=weight<=250; shipping=20


If you know that several UK_area values have the same shipping rates, you can combine them into one rule:
 Name=Qtr Pallet; UK_Area in list("BL","CW","M", "OL", "WA", "WN");  150<=weight<=250; shipping=20

Best regards,
Reinhold

shipping by UK postcode 17 Sep 2013 11:01 #3

  • aarondurber007
  • aarondurber007's Avatar Topic Author
hi

thanks for that advice but I am a little confused. Let me try and explain better

for the postcode ST1 6BS, the following works

Name=UK; Weight<=20; Shipping=6.00
Name=UK heavy; 20<=weight<=150; shipping=(articles*15-20)*0.2+6

Name=Qtr Pallet; UK_Area=="ST"; 150<=weight<=250; shipping=20



if I want to restrict it to a range of between ST1 and ST5, I try the following and it does NOT work


Name=UK; Weight<=20; Shipping=6.00
Name=UK heavy; 20<=weight<=150; shipping=(articles*15-20)*0.2+6

Name=Qtr Pallet; UK_Area=="ST" AND 5<=UK_District; 150<=weight<=250; shipping=20


I have taken this from the instructions for the plugin.

Please can you explain why you think this is not working

many thanks

shipping by UK postcode 17 Sep 2013 13:47 #4

hi
for the postcode ST1 6BS, the following works
[...]
if I want to restrict it to a range of between ST1 and ST5, I try the following and it does NOT work
[...]
Name=Qtr Pallet; UK_Area=="ST" AND 5<=UK_District; 150<=weight<=250; shipping=20


Ah, now I see.
If you want the rule to apply to values UK_District = 1, 2, 3, 4, 5, then you need to check wether the variable is smaller or equal to 5. Your condition checks whether UK_District is larger than 5 (which in your case is not the case, so the rule is not supposed to match).

I suppose you rather want
Name=Qtr Pallet; UK_Area=="ST" AND 5>=UK_District; 150<=weight<=250; shipping=20

Best regards,
Reinhold

shipping by UK postcode 17 Sep 2013 14:15 #5

  • aarondurber007
  • aarondurber007's Avatar Topic Author
still a little confused

>= means greater than or equal too
<= less than or equal too

so to restrict for postcodes ST1, ST2, ST3, ST4 and ST5 and no higher eg ST6, ST7 etc then

UK_Area=="ST" AND 5<=UK_District should be checking for postcodes up to ST5

are you saying that in this plugin that

>= less than or equal too
<= means greater than or equal too

many thanks for your help so far, however I am still a little confused on how you are using your mathematical operators. it doesn't seem to be right. I will try your version of swapping the operators around.

shipping by UK postcode 17 Sep 2013 14:48 #6

See en.wikipedia.org/wiki/Less_than for a short description of inequalities. In particular:

The notation a ≤ b means that a is less than or equal to b.
The notation a ≥ b means that a is greater than or equal to b.


So, your rule "5<=UK_District" means 5 is less than or equal the district number. Or in other words, UK_District has to have a value of 5 or larger.

are you saying that in this plugin that

>= less than or equal too
<= means greater than or equal too


No, >= means that the left side has to be larger (or equal) to the right side, and <= means that the left side has to be smaller (or equal) than the right side (or equivalently that the right side has to be larger or equal than the left side).

It's maybe easier to understand if instead of "5>=UK_District" you use "UK_District<=5" (which is absolutely the same condition).

Best regards,
Reinhold

shipping by UK postcode 17 Sep 2013 15:06 #7

  • aarondurber007
  • aarondurber007's Avatar Topic Author
many thanks

its works your way.

[SOLVED] shipping by UK postcode 17 Sep 2013 15:06 #8

  • aarondurber007
  • aarondurber007's Avatar Topic Author
Problem solved.

[SOLVED] shipping by UK postcode 17 Sep 2013 16:24 #9

  • aarondurber007
  • aarondurber007's Avatar Topic Author
one more thing please

how would I restrict for between ST14 and ST16 including

Name=Qtr Pallet; UK_Area=="ST14" AND 16>=UK_District; 150<=weight<=250; shipping=20 ????

many thanks

[SOLVED] shipping by UK postcode 17 Sep 2013 18:22 #10

Simply give 14 as the lower bound and 16 as the upper bound:
Name=Qtr Pallet; UK_Area=="ST" AND 14<=UK_District<=16; 150<=weight<=250; shipping=20

[SOLVED] shipping by UK postcode 18 Sep 2013 10:38 #11

  • aarondurber007
  • aarondurber007's Avatar Topic Author
thanks

i'll give that a try. You have been very helpful and it is most appreciated.

[SOLVED] shipping by UK postcode 18 Sep 2013 15:44 #12

  • aarondurber007
  • aarondurber007's Avatar Topic Author
All seems to be working now. Can you suggest a better way of using the following rules

Name=UK Light; Weight<=20; Shipping=6.00
Name=UK heavy; 20<=weight<=150; shipping=(articles*15-20)*0.2+6

Name=Qtr Pallet; UK_Area=="SK" AND 5>=UK_District; 150<=weight<=250; shipping=20
Name=1/2 Pallet; UK_Area=="SK" AND 5>=UK_District; 251<=weight<=500; shipping=22
Name=Full Pallet; UK_Area=="SK" AND 5>=UK_District; 501<=weight<=1000; shipping=25

Name=Qtr Pallet; UK_Area=="SK" AND 14<=UK_District<=16; 150<=weight<=250; shipping=20
Name=1/2 Pallet; UK_Area=="SK" AND 14<=UK_District<=16; 251<=weight<=500; shipping=22
Name=Full Pallet; UK_Area=="SK" AND 14<=UK_District<=16; 501<=weight<=1000; shipping=25

Name=Qtr Pallet; UK_Area=="SK" AND 6<=UK_District<=13; 150<=weight<=250; shipping=33
Name=1/2 Pallet; UK_Area=="SK" AND 6<=UK_District<=13; 251<=weight<=500; shipping=34
Name=Full Pallet; UK_Area=="SK" AND 6<=UK_District<=13; 501<=weight<=1000; shipping=44

Name=Qtr Pallet; UK_Area=="PO" AND 22>=UK_District; 150<=weight<=250; shipping=34
Name=1/2 Pallet; UK_Area=="PO" AND 22>=UK_District; 251<=weight<=500; shipping=35
Name=Full Pallet; UK_Area=="PO" AND 22>=UK_District; 501<=weight<=1000; shipping=45

Name=Qtr Pallet; UK_Area=="E" AND 2>=UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="E" AND 2>=UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="E" AND 2>=UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="E" AND 3<=UK_District<=18; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="E" AND 3<=UK_District<=18; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="E" AND 3<=UK_District<=18; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="N" AND 1==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="N" AND 1==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="N" AND 1==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="N" AND 5==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="N" AND 5==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="N" AND 5==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="N" AND 7==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="N" AND 7==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="N" AND 7==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="NW" AND 1==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="NW" AND 1==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="NW" AND 1==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="NW" AND 5==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="NW" AND 5==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="NW" AND 5==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="NW" AND 6<=UK_District<=8; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="NW" AND 6<=UK_District<=8; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="NW" AND 6<=UK_District<=8; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="SE" AND 1==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="SE" AND 1==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="SE" AND 1==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="SE" AND 11==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="SE" AND 11==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="SE" AND 11==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="SE" AND 16<=UK_District<=17; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="SE" AND 16<=UK_District<=17; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="SE" AND 16<=UK_District<=17; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="SW" AND 1==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="SW" AND 1==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="SW" AND 1==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="SW" AND 3<=UK_District<=11; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="SW" AND 3<=UK_District<=11; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="SW" AND 3<=UK_District<=11; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="SW" AND 13==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="SW" AND 13==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="SW" AND 13==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="SW" AND 18==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="SW" AND 18==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="SW" AND 18==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="W" AND 4>=UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="W" AND 4>=UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="W" AND 4>=UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="W" AND 6==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="W" AND 6==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="W" AND 6==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="W" AND 8<=UK_District<=12; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="W" AND 8<=UK_District<=12; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="W" AND 8<=UK_District<=12; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="W" AND 14==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="W" AND 14==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="W" AND 14==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="N" AND 2<=UK_District<=4; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="N" AND 2<=UK_District<=4; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="N" AND 2<=UK_District<=4; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="N" AND 6==UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="N" AND 6==UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="N" AND 6==UK_District; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="N" AND 8<=UK_District<=22; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="N" AND 8<=UK_District<=22; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="N" AND 8<=UK_District<=22; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="NW" AND 2<=UK_District<=4; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="NW" AND 2<=UK_District<=4; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="NW" AND 2<=UK_District<=4; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="NW" AND 9<=UK_District<=11; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="NW" AND 9<=UK_District<=11; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="NW" AND 9<=UK_District<=11; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="NW" AND 7==UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="NW" AND 7==UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="NW" AND 7==UK_District; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SE" AND 2<=UK_District<=10; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SE" AND 2<=UK_District<=10; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SE" AND 2<=UK_District<=10; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SE" AND 12<=UK_District<=15; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SE" AND 12<=UK_District<=15; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SE" AND 12<=UK_District<=15; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SE" AND 18<=UK_District<=28; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SE" AND 18<=UK_District<=28; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SE" AND 18<=UK_District<=28; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SW" AND 2==UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SW" AND 2==UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SW" AND 2==UK_District; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SW" AND 12==UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SW" AND 12==UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SW" AND 12==UK_District; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SW" AND 14<=UK_District<=17; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SW" AND 14<=UK_District<=17; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SW" AND 14<=UK_District<=17; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SW" AND 19==UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SW" AND 19==UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SW" AND 19==UK_District; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="SW" AND 20==UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="SW" AND 20==UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="SW" AND 20==UK_District; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="PA" AND 19>=UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="PA" AND 19>=UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="PA" AND 19>=UK_District; 501<=weight<=1000; shipping=60

Name=Qtr Pallet; UK_Area=="PH" AND 18>=UK_District; 150<=weight<=250; shipping=52
Name=1/2 Pallet; UK_Area=="PH" AND 18>=UK_District; 251<=weight<=500; shipping=61
Name=Full Pallet; UK_Area=="PH" AND 18>=UK_District; 501<=weight<=1000; shipping=67

Name=Qtr Pallet; UK_Area in list("BL", "CW", "M", "OL", "WA", "WN"); 150<=weight<=250; shipping=20
Name=1/2 Pallet; UK_Area in list("BL", "CW", "M", "OL", "WA", "WN"); 151<=weight<=500; shipping=22
Name=FULL Pallet; UK_Area in list("BL", "CW", "M", "OL", "WA", "WN"); 501<=weight<=1000; shipping=25

Name=Qtr Pallet; UK_Area in list("AL", "B", "BA", "BB", "BD", "BS", "CB", "CH", "CV", "DE", "DN", "DY", "GL", "GU", "HD", "HP", "HR", "HX", "L", "LE", "LS", "LU", "MK", "NG", "NN", "OX", "PE", "PR", "RG", "RH", "S", "SG", "SL", "SN", "ST", "TF", "WD", "WF", "WR", "WS", "WV"); 150<=weight<=250; shipping=33
Name=1/2 Pallet; UK_Area in list("AL", "B", "BA", "BB", "BD", "BS", "CB", "CH", "CV", "DE", "DN", "DY", "GL", "GU", "HD", "HP", "HR", "HX", "L", "LE", "LS", "LU", "MK", "NG", "NN", "OX", "PE", "PR", "RG", "RH", "S", "SG", "SL", "SN", "ST", "TF", "WD", "WF", "WR", "WS", "WV"); 251<=weight<=500; shipping=34
Name=FULL Pallet; UK_Area in list("AL", "B", "BA", "BB", "BD", "BS", "CB", "CH", "CV", "DE", "DN", "DY", "GL", "GU", "HD", "HP", "HR", "HX", "L", "LE", "LS", "LU", "MK", "NG", "NN", "OX", "PE", "PR", "RG", "RH", "S", "SG", "SL", "SN", "ST", "TF", "WD", "WF", "WR", "WS", "WV"); 501<=weight<=1000; shipping=44

Name=Qtr Pallet; UK_Area in list("BH", "BN", "CF", "CM", "CO", "DH", "DL", "DT", "FY", "HG", "HU", "IP", "LA", "LN", "ME", "NE", "NP", "NR", "SO", "SP", "SR", "SS", "TA", "TS", "YO"); 150<=weight<=250; shipping=34
Name=1/2 Pallet; UK_Area in list("BH", "BN", "CF", "CM", "CO", "DH", "DL", "DT", "FY", "HG", "HU", "IP", "LA", "LN", "ME", "NE", "NP", "NR", "SO", "SP", "SR", "SS", "TA", "TS", "YO"); 251<=weight<=500; shipping=35
Name=FULL Pallet; UK_Area in list("BH", "BN", "CF", "CM", "CO", "DH", "DL", "DT", "FY", "HG", "HU", "IP", "LA", "LN", "ME", "NE", "NP", "NR", "SO", "SP", "SR", "SS", "TA", "TS", "YO"); 501<=weight<=1000; shipping=45

Name=Qtr Pallet; UK_Area in list("CA", "CT", "EX", "LD", "LL", "PL", "SA", "SY", "TN", "TQ", "TR"); 150<=weight<=250; shipping=47
Name=1/2 Pallet; UK_Area in list("CA", "CT", "EX", "LD", "LL", "PL", "SA", "SY", "TN", "TQ", "TR"); 251<=weight<=500; shipping=50
Name=FULL Pallet; UK_Area in list("CA", "CT", "EX", "LD", "LL", "PL", "SA", "SY", "TN", "TQ", "TR"); 501<=weight<=1000; shipping=58

Name=Qtr Pallet; UK_Area in list("EC", "WC"); 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area in list("EC", "WC"); 251<=weight<=500; shipping=45
Name=FULL Pallet; UK_Area in list("EC", "WC"); 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area in list("BR", "CR", "DA", "LD", "EN", "HA", "IG", "KT", "RM", "SM", "TW", "UB"); 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area in list("BR", "CR", "DA", "LD", "EN", "HA", "IG", "KT", "RM", "SM", "TW", "UB"); 251<=weight<=500; shipping=47
Name=FULL Pallet; UK_Area in list("BR", "CR", "DA", "LD", "EN", "HA", "IG", "KT", "RM", "SM", "TW", "UB"); 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area in list("EH", "G", "FK", "ML", "KA", "KY"); 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area in list("EH", "G", "FK", "ML", "KA", "KY"); 201<=weight<=500; shipping=47
Name=FULL Pallet; UK_Area in list("EH", "G", "FK", "ML", "KA", "KY"); 501<=weight<=1000; shipping=60

Name=Qtr Pallet; UK_Area in list("AB", "DD", "DG", "TD"); 150<=weight<=250; shipping=52
Name=1/2 Pallet; UK_Area in list("AB", "DD", "DG", "TD"); 201<=weight<=500; shipping=61
Name=FULL Pallet; UK_Area in list("AB", "DD", "DG", "TD"); 501<=weight<=1000; shipping=67



many thanks

[SOLVED] shipping by UK postcode 20 Sep 2013 22:46 #13

Wow, that's an impressive list of rules!

I only see some minor simplifications using OR to combine the checks for different districts. E.g. you could rewrite these rules
Name=Qtr Pallet; UK_Area=="N" AND 6==UK_District; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="N" AND 6==UK_District; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="N" AND 6==UK_District; 501<=weight<=1000; shipping=51

Name=Qtr Pallet; UK_Area=="N" AND 8<=UK_District<=22; 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="N" AND 8<=UK_District<=22; 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="N" AND 8<=UK_District<=22; 501<=weight<=1000; shipping=51

as
Name=Qtr Pallet; UK_Area=="N" AND (6==UK_District OR 8<=UK_District<=22); 150<=weight<=250; shipping=44
Name=1/2 Pallet; UK_Area=="N" AND (6==UK_District OR 8<=UK_District<=22); 251<=weight<=500; shipping=47
Name=Full Pallet; UK_Area=="N" AND (6==UK_District OR 8<=UK_District<=22); 501<=weight<=1000; shipping=51

Similarly, if you check multiple values separately, you could just as well check them in one go. E.g. instead of
Name=Qtr Pallet; UK_Area=="N" AND 1==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="N" AND 1==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="N" AND 1==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="N" AND 5==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="N" AND 5==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="N" AND 5==UK_District; 501<=weight<=1000; shipping=54

Name=Qtr Pallet; UK_Area=="N" AND 7==UK_District; 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="N" AND 7==UK_District; 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="N" AND 7==UK_District; 501<=weight<=1000; shipping=54

you can simply use a list check to combine the district checks into one:
Name=Qtr Pallet; UK_Area=="N" AND UK_District in list(1,5,7); 150<=weight<=250; shipping=43
Name=1/2 Pallet; UK_Area=="N" AND UK_District in list(1,5,7); 251<=weight<=500; shipping=45
Name=Full Pallet; UK_Area=="N" AND UK_District in list(1,5,7); 501<=weight<=1000; shipping=54
  • Page:
  • 1