Shipping By Rules for WooCommerce

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!



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


UK Postcodes - supplements 04 Mar 2016 12:38 #1

  • Tim.Latham
  • Tim.Latham's Avatar Topic Author

So far I've put in the following rules that seem to work fine to define shipping rate dependent upon volumetric size of the largest item plus £11.90 per additional item. The 1.2 multiplier is UK VAT ie 20%.

Name="Large"; 750000>MaxVolume>350001; Shipping=(41.00+((articles-1)*11.90))*1.2
Name="Medium"; 350000>MaxVolume>210001; Shipping=(31.00+((articles-1)*11.90))*1.2
Name="Small"; 210000>MaxVolume>0; Shipping=(21.00+((articles-1)*11.90))*1.2
Name="Extra Large"; 1200000>MaxVolume>750001; Shipping=(56.50+((articles-1)*11.90))*1.2

But I now need to develop these rules to take account of different UK postcodes (UK_outward and UK_area ) incurring supplements for instance:

London congestion charge zone:
W1, W2, W8, W10, W11, NW1, WC1, WC2, EC1, EC2, EC3, EC4, E1, SW1, SW3, SW7, SE1, SE11

supplement of £4 plus 20% VAT

Scotland Postcodes:
EH, DG, FK, G, KA 1-26, 29, 30, KY, ML, PA 1-19, TD

supplement of £26.09 plus 20% VAT


Any help very greatly appreciated.



UK Postcodes - supplements 04 Mar 2016 23:18 #2

Dear Tim,
Please see my reply in the other thread: open-tools.net/forum/shipping-by-rules-p...code-range.html#7156

Please note that you need to put the ExtraShippingCharge rules first, because the plugin stops evaluating rules as soon as it finds one that defines shipping costs (i.e. where all conditions are matched). So the extra charge needs to be defined before the rules that apply.

Best regards,

UK Postcodes - supplements 05 Mar 2016 17:27 #3

  • Tim.Latham
  • Tim.Latham's Avatar Topic Author
Brilliant, thankyou.

So making good progress and I've instituted a first "ExtraShippingCharge " rule see below:

Name="UK Zone 2"; UK_Area=="PA"; 21<=UK_District<=38; ExtraShippingCharge=49.00*1.2

Now if, for that same ExtraShippingCharge of £49*1.2 I need to add in other postcode options such as:

AB, DD, IV 1-28, 30-32, 36, 40-49, 52-56, 63, KW 1-3, 5-14, PH 1-26, 30-41, 49-50

Can I use "OR" logic and brackets - can you help me out on the syntax of that please.



UK Postcodes - supplements 05 Mar 2016 18:47 #4

Dear Tim,
For simplicity I would not use too many OR operators (even though you can, of course). I would rather use multiple rules with ExtraShippingCharge:
UK_Area in list("AB", "DD"); ExtraShippingCharge=49.00*1.2
UK_Area==KW; 1<=UK_District<=14; UK_District != 4; ExtraShippingCharge=49.00*1.2
UK_Area=="IV"; (1<=UK_District<=28) OR (40<=UK_District<=49) OR (UK_District in list(30, 31, 32, 36, 52, 53, 54, 55, 56, 63); ExtraShippingCharge=49.00*1.2
... etc....

Please note that the Name for rules with ExtraShippingCharge does not have any effect, it is (at least for now) merely a comment for you.

Best regards,

UK Postcodes - supplements 07 Mar 2016 12:42 #5

  • Tim.Latham
  • Tim.Latham's Avatar Topic Author

I've put in loads of rules and I think they are working!

Now for some detailed testing.



[SOLVED] UK Postcodes - supplements 07 Mar 2016 12:42 #6

  • Tim.Latham
  • Tim.Latham's Avatar Topic Author
Problem solved.
  • Page:
  • 1