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 certain states for a country 27 Mar 2013 23:40 #1

  • manuxx
  • manuxx's Avatar Topic Author
Hi Reinhold

My boss today asked me something which I have no clue about.

If we wanted to exclude from the shipping for example a concrete state from a country.

Example= excluding the island of Madeira from Portugal.

I guess we can use the zip codes.

I know asking is free but it would be nice being capable of blocking or excluding a concrete zip code (state)

This is quite useful in countries with islands where the islands have a different price.
We made it already by zip code for the balearic islands in Spain, but Spain doest have a lot of states and in some countries it could be a nightmare to put all those lines:
Name=Península, max 6kg; 01000<=ZIP<06999; Weight<6; Shipping=4.81
Name=Península, max 11kg; 01000<=ZIP<06999; 7<=Weight<11; Shipping=5.77
Name=Península, max 16kg; 01000<=ZIP<06999; 12<=Weight<16; Shipping=6.73
Name=Península, max 21kg; 01000<=ZIP<06999; 17<=Weight<21; Shipping=7.69
Name=Península, max 26kg; 01000<=ZIP<06999; 22<=Weight<26; Shipping=9.62
Name=Península, max 31kg; 01000<=ZIP<06999; 27<=Weight<31; Shipping=11.54
Name=Península, max 36kg; 01000<=ZIP<06999; 32<=Weight<36; Shipping=13.46
Name=Península, max 41kg; 01000<=ZIP<06999; 37<=Weight<41; Shipping=15.38
Name=Península, max 46kg; 01000<=ZIP<06999; 42<=Weight<46; Shipping=17.31
Name=Península, max 51kg; 01000<=ZIP<06999; 47<=Weight<51; Shipping=19.23
Name=Península, max 61kg; 01000<=ZIP<06999; 52<=Weight<61; Shipping=23.08
Name=Península, max 71kg; 01000<=ZIP<06999; 62<=Weight<71; Shipping=26.92
Name=Península, max 81kg; 01000<=ZIP<06999; 72<=Weight<81; Shipping=30.77
Name=Península, max 91kg; 01000<=ZIP<06999; 82<=Weight<91; Shipping=34.52
Name=Península, max 100kg; 01000<=ZIP<06999; 92<=Weight<101; Shipping=38.46
Name=Baleares, max 6kg; 07000<=ZIP<07999; Weight<6; Shipping=10.58
Name=Baleares, max 11kg; 07000<=ZIP<07999; 7<=Weight<11; Shipping=10.58
Name=Baleares, max 16kg; 07000<=ZIP<07999; 12<=Weight<16; Shipping=13.46
Name=Baleares, max 21kg; 07000<=ZIP<07999; 17<=Weight<21; Shipping=15.38
Name=Baleares, max 26kg; 07000<=ZIP<07999; 22<=Weight<26; Shipping=17.31
Name=Baleares, max 31kg; 07000<=ZIP<07999; 27<=Weight<31; Shipping=17.31
Name=Baleares, max 36kg; 07000<=ZIP<07999; 32<=Weight<36; Shipping=19.23
Name=Baleares, max 41kg; 07000<=ZIP<07999; 37<=Weight<41; Shipping=24.04
Name=Baleares, max 46kg; 07000<=ZIP<07999; 42<=Weight<46; Shipping=26.92
Name=Baleares, max 51kg; 07000<=ZIP<07999; 47<=Weight<51; Shipping=28.85
Name=Baleares, max 61kg; 07000<=ZIP<07999; 52<=Weight<61; Shipping=30.77
Name=Baleares, max 71kg; 07000<=ZIP<07999; 62<=Weight<71; Shipping=38.46
Name=Baleares, max 81kg; 07000<=ZIP<07999; 72<=Weight<81; Shipping=43.27
Name=Baleares, max 91kg; 07000<=ZIP<07999; 82<=Weight<91; Shipping=48.08
Name=Baleares, max 100kg; 07000<=ZIP<07999; 92<=Weight<101; Shipping=52.88
Name=Península, max 6kg; 08000<=ZIP<34999; Weight<6; Shipping=4.81
Name=Península, max 11kg; 08000<=ZIP<34999; 7<=Weight<11; Shipping=5.77
Name=Península, max 16kg; 08000<=ZIP<34999; 12<=Weight<16; Shipping=6.73
Name=Península, max 21kg; 08000<=ZIP<34999; 17<=Weight<21; Shipping=7.69
Name=Península, max 26kg; 08000<=ZIP<34999; 22<=Weight<26; Shipping=9.62
Name=Península, max 31kg; 08000<=ZIP<34999; 27<=Weight<31; Shipping=11.54
Name=Península, max 36kg; 08000<=ZIP<34999; 32<=Weight<36; Shipping=13.46
Name=Península, max 41kg; 08000<=ZIP<34999; 37<=Weight<41; Shipping=15.38
Name=Península, max 46kg; 08000<=ZIP<34999; 42<=Weight<46; Shipping=17.31
Name=Península, max 51kg; 08000<=ZIP<34999; 47<=Weight<51; Shipping=19.23
Name=Península, max 61kg; 08000<=ZIP<34999; 52<=Weight<61; Shipping=23.08
Name=Península, max 71kg; 08000<=ZIP<34999; 62<=Weight<71; Shipping=26.92
Name=Península, max 81kg; 08000<=ZIP<34999; 72<=Weight<81; Shipping=30.77
Name=Península, max 91kg; 08000<=ZIP<34999; 82<=Weight<91; Shipping=34.52
Name=Península, max 100kg; 08000<=ZIP<34999; 92<=Weight<101; Shipping=38.46
Name=Península, max 6kg; 36000<=ZIP<37999; Weight<6; Shipping=4.81
Name=Península, max 11kg; 36000<=ZIP<37999; 7<=Weight<11; Shipping=5.77
Name=Península, max 16kg; 36000<=ZIP<37999; 12<=Weight<16; Shipping=6.73
Name=Península, max 21kg; 36000<=ZIP<37999; 17<=Weight<21; Shipping=7.69
Name=Península, max 26kg; 36000<=ZIP<37999; 22<=Weight<26; Shipping=9.62
Name=Península, max 31kg; 36000<=ZIP<37999; 27<=Weight<31; Shipping=11.54
Name=Península, max 36kg; 36000<=ZIP<37999; 32<=Weight<36; Shipping=13.46
Name=Península, max 41kg; 36000<=ZIP<37999; 37<=Weight<41; Shipping=15.38
Name=Península, max 46kg; 36000<=ZIP<37999; 42<=Weight<46; Shipping=17.31
Name=Península, max 51kg; 36000<=ZIP<37999; 47<=Weight<51; Shipping=19.23
Name=Península, max 61kg; 36000<=ZIP<37999; 52<=Weight<61; Shipping=23.08
Name=Península, max 71kg; 36000<=ZIP<37999; 62<=Weight<71; Shipping=26.92
Name=Península, max 81kg; 36000<=ZIP<37999; 72<=Weight<81; Shipping=30.77
Name=Península, max 91kg; 36000<=ZIP<37999; 82<=Weight<91; Shipping=34.52
Name=Península, max 100kg; 36000<=ZIP<37999; 92<=Weight<101; Shipping=38.46
Name=Península, max 6kg; 39000<=ZIP<50999; Weight<6; Shipping=4.81
Name=Península, max 11kg; 39000<=ZIP<50999; 7<=Weight<11; Shipping=5.77
Name=Península, max 16kg; 39000<=ZIP<50999; 12<=Weight<16; Shipping=6.73
Name=Península, max 21kg; 39000<=ZIP<50999; 17<=Weight<21; Shipping=7.69
Name=Península, max 26kg; 39000<=ZIP<50999; 22<=Weight<26; Shipping=9.62
Name=Península, max 31kg; 39000<=ZIP<50999; 27<=Weight<31; Shipping=11.54
Name=Península, max 36kg; 39000<=ZIP<50999; 32<=Weight<36; Shipping=13.46
Name=Península, max 41kg; 39000<=ZIP<50999; 37<=Weight<41; Shipping=15.38
Name=Península, max 46kg; 39000<=ZIP<50999; 42<=Weight<46; Shipping=17.31
Name=Península, max 51kg; 39000<=ZIP<50999; 47<=Weight<51; Shipping=19.23
Name=Península, max 61kg; 39000<=ZIP<50999; 52<=Weight<61; Shipping=23.08
Name=Península, max 71kg; 39000<=ZIP<50999; 62<=Weight<71; Shipping=26.92
Name=Península, max 81kg; 39000<=ZIP<50999; 72<=Weight<81; Shipping=30.77
Name=Península, max 91kg; 39000<=ZIP<50999; 82<=Weight<91; Shipping=34.52
Name=Península, max 100kg; 39000<=ZIP<50999; 92<=Weight<101; Shipping=38.46
Name=Península, max 6kg; 53000<=ZIP<99999; Weight<6; Shipping=4.81
Name=Península, max 11kg; 53000<=ZIP<99999; 7<=Weight<11; Shipping=5.77
Name=Península, max 16kg; 53000<=ZIP<99999; 12<=Weight<16; Shipping=6.73
Name=Península, max 21kg; 53000<=ZIP<99999; 17<=Weight<21; Shipping=7.69
Name=Península, max 26kg; 53000<=ZIP<99999; 22<=Weight<26; Shipping=9.62
Name=Península, max 31kg; 53000<=ZIP<99999; 27<=Weight<31; Shipping=11.54
Name=Península, max 36kg; 53000<=ZIP<99999; 32<=Weight<36; Shipping=13.46
Name=Península, max 41kg; 53000<=ZIP<99999; 37<=Weight<41; Shipping=15.38
Name=Península, max 46kg; 53000<=ZIP<99999; 42<=Weight<46; Shipping=17.31
Name=Península, max 51kg; 53000<=ZIP<99999; 47<=Weight<51; Shipping=19.23
Name=Península, max 61kg; 53000<=ZIP<99999; 52<=Weight<61; Shipping=23.08
Name=Península, max 71kg; 53000<=ZIP<99999; 62<=Weight<71; Shipping=26.92
Name=Península, max 81kg; 53000<=ZIP<99999; 72<=Weight<81; Shipping=30.77
Name=Península, max 91kg; 53000<=ZIP<99999; 82<=Weight<91; Shipping=34.52
Name=Península, max 100kg; 53000<=ZIP<99999; 92<=Weight<101; Shipping=38.46

But for example for Portugal we didnt make a difference in zip codes, so basicly a shopper from the island of Madeira is charged the same as a shopper from Lisboa, so would be nice to have a rule that excluded a concrete state via the zip code maybe? just an idea. Regards
Name=Portugal, max 6kg; Weight<6; Shipping=7.69
Name=Portugal, max 11kg; 7<=Weight<11; Shipping=8.65
Name=Portugal, max 16kg; 12<=Weight<16; Shipping=9.62
Name=Portugal, max 21kg; 17<=Weight<21; Shipping=12.50
Name=Portugal, max 26kg; 22<=Weight<26; Shipping=16.35
Name=Portugal, max 31kg; 27<=Weight<31; Shipping=20.19
Name=Portugal, max 36kg; 32<=Weight<36; Shipping=24.04
Name=Portugal, max 41kg; 37<=Weight<41; Shipping=27.88
Name=Portugal, max 46kg; 42<=Weight<46; Shipping=31.73
Name=Portugal, max 51kg; 47<=Weight<51; Shipping=35.58
Name=Portugal, max 61kg; 52<=Weight<61; Shipping=43.27
Name=Portugal, max 71kg; 62<=Weight<71; Shipping=50.96
Name=Portugal, max 81kg; 72<=Weight<81; Shipping=58.65
Name=Portugal, max 91kg; 82<=Weight<91; Shipping=66.35
Name=Portugal, max 100kg; 92<=Weight<101; Shipping=74.04
Name=Portugal; Weight>102; Shipping=74.04+(Weight-101)*0.6

Exclude certain states for a country 28 Mar 2013 00:45 #2

Hi Reinhold
If we wanted to exclude from the shipping for example a concrete state from a country.
I guess we can use the zip codes.


Exactly, currenlty the postcodes are the only way to exclude certain areas of a country.

We made it already by zip code for the balearic islands in Spain, but Spain doest have a lot of states and in some countries it could be a nightmare to put all those lines:


One trick is to exploit the fact that the plugin always returns the first matching rule. So if you rearrange the rules, you can put those islands first, and all remaining rules do not have to add the ZIP conditions any more:
Name=Baleares; 07000<=ZIP<08000; Weight<6; Shipping=10.58
Name=Las Palmas; 35000<=ZIP<36000; Weight<6; Shipping=10.58
Name=Some other Island; 38000<=ZIP<39000; Weight<6; Shipping=10.58
Name=Ceuta and Melilla; 51000<=ZIP<53000; Weight<6; Shipping=10.58
Name=Península (all other ZIP codes); Weight<6; Shipping=4.81

BTW, I think you misunderstood the exact (mathematical) meaning of the 01000<=ZIP<06999 comparison: It matches all postcodes that are larger or equal to 01000 and STRICTLY smaller (but not equal) than 06999. In particular, if the ZIP is 06999, it will NOT match!

But for example for Portugal we didnt make a difference in zip codes, so basicly a shopper from the island of Madeira is charged the same as a shopper from Lisboa, so would be nice to have a rule that excluded a concrete state via the zip code maybe?


It's currently only possible to give different shipping costs, but not to explicitly exclude a particular ZIP range from the method. The only way is to add conditions to all rules so that the ZIP range does not match any of the rules.

But you are right, it might be a good idea to disable shipping by rules, something like:
Name=No shipping to Azores and Madeira; 9000<=ZIP; NoShipping

As soon as this rules matches (and no other rule before it matches), the shipping method will not offer shipping. I have put that on my list of ideas, but I don't know when or if I'll implement it.

Exclude certain states for a country 28 Mar 2013 01:15 #3

  • manuxx
  • manuxx's Avatar Topic Author
Oh jesus, thanks for pointing that out, that is why I never passed maths at school :P

Already corrected it and changed 06999 to 07000 and the same with the other ones ending in 9999 cause those are real zip codes for different states in spain.

Thanks for the help.

Would be great that rule to disable shipping, wheter is done or not we are really happy with this plugin and your help.

Regards

[SOLVED] Exclude certain states for a country 28 Mar 2013 01:24 #4

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

Exclude certain states for a country 31 Mar 2013 14:23 #5

  • manuxx
  • manuxx's Avatar Topic Author
Wow thanks a lot for implementing these rule.

Regards
  • Page:
  • 1