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 rules according to weight, zip code 09 Nov 2013 14:10 #1

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
Hello, i've been using your excellent extension for some time now and it works great, but i need now to differentiate shipping between the Spanish peninsula and Balearic Islands. I've tried this but it doesn't work:


//Peninsula

Name=Portes gratis; MinWeight==0; Shipping=0
Name=MRW 24/48H; Amount>=70; Shipping=0
Name=MRW 24/48H; 0<Weight<=2; Shipping=6.91
Name=MRW 24/48H; 2<Weight<=5; Shipping=9.03
Name=MRW 24/48H; 5<Weight<=10; Shipping=11.18
Name=MRW 24/48H; 10<Weight<=15; Shipping=13.32
Name=MRW 24/48H; 15<Weight<=20; Shipping=15.46
Name=MRW 24/48H; 20<Weight<=40; Shipping=28.16
Name=MRW 24/48H; Weight>40; Shipping=28.16

// Balearic Islands

Name=MRW (3-5 días); 07000<ZIP<=07872; MinWeight==0; Shipping=33
Name=MRW (3-5 days); 07001<ZIP<=07872; 0<Weight<=3; Shipping=17.75
Name=MRW (3-5 days); 07001<ZIP<=07872; 3<Weight<=5; Shipping=19.27
Name=MRW (3-5 days); 07001<ZIP<=07872; 5<Weight<=10; Shipping=27.89
Name=MRW (3-5 days); 07001<ZIP<=07872; 10<Weight<=15; Shipping=32.97
Name=MRW (3-5 days); 07001<ZIP<=07872; Weight>15; Shipping=55

Also i need this rule "Name=MRW 24/48H; Amount>=70; Shipping=0" not to be applied to the Balearic Islands, but i don't know how.

Whay am i doing wrong?

Thank you so much.

Shipping rules according to weight, zip code 09 Nov 2013 20:09 #2

  • manuxx
  • manuxx's Avatar
Hola

Te paso como lo tenemos nosotros por si te sirve de referencia, esto es toda península y baleares, diferenciado. Si usas la misma lógica lo puedes acoplar a tus portes de MRW, basicamente es por código postal e intervalos de peso como haces tú:

Para la formula de nuevo usa los delimitadores de código postal, fijate como nosotros incluimos una formula al final de cada rango de códigos postales, te marco en negro la primera, es una formula que calcula el precio por kg pero usa la tuya para portes gratuitos. De esa forma solo se aplicará a los códigos postales seleccionados en la formula.


Sorry I've assumed you are spanish, basicly im saying this is how we differentiate between Spain península and Balearic Islands, by zip code and weight interval, we also apply a formula for price per kg that Reinhold told us and works really well, in your case just apply your formula like us, after each zip code interval so that it only applies there.
You can see that the formula is applied at the end of each Zip Code interval, that way you can make different formulas per zip code (and therefore difference between península and Baleares) I mark in black the first one.


For us this was the easiest way:

Name=Península, max 6kg; 01000<=ZIP<07000; Weight<=6; Shipping=4.81
Name=Península, max 11kg; 01000<=ZIP<07000; 7<=Weight<=11; Shipping=5.77
Name=Península, max 16kg; 01000<=ZIP<07000; 12<=Weight<=16; Shipping=6.73
Name=Península, max 21kg; 01000<=ZIP<07000; 17<=Weight<=21; Shipping=8.65
Name=Península, max 26kg; 01000<=ZIP<07000; 22<=Weight<=26; Shipping=10.58
Name=Península, max 31kg; 01000<=ZIP<07000; 27<=Weight<=31; Shipping=11.54
Name=Península, max 36kg; 01000<=ZIP<07000; 32<=Weight<=36; Shipping=13.46
Name=Península, max 41kg; 01000<=ZIP<07000; 37<=Weight<=41; Shipping=15.38
Name=Península, max 46kg; 01000<=ZIP<07000; 42<=Weight<=46; Shipping=17.31
Name=Península, max 51kg; 01000<=ZIP<07000; 47<=Weight<=51; Shipping=19.23
Name=Península, max 61kg; 01000<=ZIP<07000; 52<=Weight<=61; Shipping=23.08
Name=Península, max 71kg; 01000<=ZIP<07000; 62<=Weight<=71; Shipping=26.92
Name=Península, max 81kg; 01000<=ZIP<07000; 72<=Weight<=81; Shipping=30.77
Name=Península, max 91kg; 01000<=ZIP<07000; 82<=Weight<=91; Shipping=34.62
Name=Península, max 100kg; 01000<=ZIP<07000; 92<=Weight<=101; Shipping=38.46
Name=Spain, Weight=>102; 01000<=ZIP<07000; Shipping=38.46+(Weight-101)*0.1
Name=Baleares, max 6kg; 07000<=ZIP<08000; Weight<=6; Shipping=10.58
Name=Baleares, max 11kg; 07000<=ZIP<08000; 7<=Weight<=11; Shipping=10.58
Name=Baleares, max 16kg; 07000<=ZIP<08000; 12<=Weight<=16; Shipping=13.46
Name=Baleares, max 21kg; 07000<=ZIP<08000; 17<=Weight<=21; Shipping=15.38
Name=Baleares, max 26kg; 07000<=ZIP<08000; 22<=Weight<=26; Shipping=17.31
Name=Baleares, max 31kg; 07000<=ZIP<08000; 27<=Weight<=31; Shipping=17.31
Name=Baleares, max 36kg; 07000<=ZIP<08000; 32<=Weight<=36; Shipping=19.23
Name=Baleares, max 41kg; 07000<=ZIP<08000; 37<=Weight<=41; Shipping=24.04
Name=Baleares, max 46kg; 07000<=ZIP<08000; 42<=Weight<=46; Shipping=26.92
Name=Baleares, max 51kg; 07000<=ZIP<08000; 47<=Weight<=51; Shipping=28.85
Name=Baleares, max 61kg; 07000<=ZIP<08000; 52<=Weight<=61; Shipping=30.77
Name=Baleares, max 71kg; 07000<=ZIP<08000; 62<=Weight<=71; Shipping=38.46
Name=Baleares, max 81kg; 07000<=ZIP<08000; 72<=Weight<=81; Shipping=43.27
Name=Baleares, max 91kg; 07000<=ZIP<08000; 82<=Weight<=91; Shipping=48.08
Name=Baleares, max 100kg; 07000<=ZIP<08000; 92<=Weight<=101; Shipping=52.88
Name=Spain, Weight>102; 07000<=ZIP<08000; Shipping=38.46+(Weight-101)*0.1
Name=Península, max 6kg; 08000<=ZIP<35000; Weight<=6; Shipping=4.81
Name=Península, max 11kg; 08000<=ZIP<35000; 7<=Weight<=11; Shipping=5.77
Name=Península, max 16kg; 08000<=ZIP<35000; 12<=Weight<=16; Shipping=6.73
Name=Península, max 21kg; 08000<=ZIP<35000; 17<=Weight<=21; Shipping=8.65
Name=Península, max 26kg; 08000<=ZIP<35000; 22<=Weight<=26; Shipping=10.58
Name=Península, max 31kg; 08000<=ZIP<35000; 27<=Weight<=31; Shipping=11.54
Name=Península, max 36kg; 08000<=ZIP<35000; 32<=Weight<=36; Shipping=13.46
Name=Península, max 41kg; 08000<=ZIP<35000; 37<=Weight<=41; Shipping=15.38
Name=Península, max 46kg; 08000<=ZIP<35000; 42<=Weight<=46; Shipping=17.31
Name=Península, max 51kg; 08000<=ZIP<35000; 47<=Weight<=51; Shipping=19.23
Name=Península, max 61kg; 08000<=ZIP<35000; 52<=Weight<=61; Shipping=23.08
Name=Península, max 71kg; 08000<=ZIP<35000; 62<=Weight<=71; Shipping=26.92
Name=Península, max 81kg; 08000<=ZIP<35000; 72<=Weight<=81; Shipping=30.77
Name=Península, max 91kg; 08000<=ZIP<35000; 82<=Weight<=91; Shipping=34.62
Name=Península, max 100kg; 08000<=ZIP<35000; 92<=Weight<=101; Shipping=38.46
Name=Spain, Weight>102; 08000<=ZIP<35000; Shipping=38.46+(Weight-101)*0.1
Name=Península, max 6kg; 36000<=ZIP<38000; Weight<=6; Shipping=4.81
Name=Península, max 11kg; 36000<=ZIP<38000; 7<=Weight<=11; Shipping=5.77
Name=Península, max 16kg; 36000<=ZIP<38000; 12<=Weight<=16; Shipping=6.73
Name=Península, max 21kg; 36000<=ZIP<38000; 17<=Weight<=21; Shipping=8.65
Name=Península, max 26kg; 36000<=ZIP<38000; 22<=Weight<=26; Shipping=10.58
Name=Península, max 31kg; 36000<=ZIP<38000; 27<=Weight<=31; Shipping=11.54
Name=Península, max 36kg; 36000<=ZIP<38000; 32<=Weight<=36; Shipping=13.46
Name=Península, max 41kg; 36000<=ZIP<38000; 37<=Weight<=41; Shipping=15.38
Name=Península, max 46kg; 36000<=ZIP<38000; 42<=Weight<=46; Shipping=17.31
Name=Península, max 51kg; 36000<=ZIP<38000; 47<=Weight<=51; Shipping=19.23
Name=Península, max 61kg; 36000<=ZIP<38000; 52<=Weight<=61; Shipping=23.08
Name=Península, max 71kg; 36000<=ZIP<38000; 62<=Weight<=71; Shipping=26.92
Name=Península, max 81kg; 36000<=ZIP<38000; 72<=Weight<=81; Shipping=30.77
Name=Península, max 91kg; 36000<=ZIP<38000; 82<=Weight<=91; Shipping=34.62
Name=Península, max 100kg; 36000<=ZIP<38000; 92<=Weight<=101; Shipping=38.46
Name=Spain, Weight>102; 36000<=ZIP<38000; Shipping=38.46+(Weight-101)*0.1
Name=Península, max 6kg; 39000<=ZIP<60000; Weight<=6; Shipping=4.81
Name=Península, max 11kg; 39000<=ZIP<60000; 7<=Weight<=11; Shipping=5.77
Name=Península, max 16kg; 39000<=ZIP<60000; 12<=Weight<=16; Shipping=6.73
Name=Península, max 21kg; 39000<=ZIP<60000; 17<=Weight<=21; Shipping=8.65
Name=Península, max 26kg; 39000<=ZIP<60000; 22<=Weight<=26; Shipping=10.58
Name=Península, max 31kg; 39000<=ZIP<60000; 27<=Weight<=31; Shipping=11.54
Name=Península, max 36kg; 39000<=ZIP<60000; 32<=Weight<=36; Shipping=13.46
Name=Península, max 41kg; 39000<=ZIP<60000; 37<=Weight<=41; Shipping=15.38
Name=Península, max 46kg; 39000<=ZIP<60000; 42<=Weight<=46; Shipping=17.31
Name=Península, max 51kg; 39000<=ZIP<60000; 47<=Weight<=51; Shipping=19.23
Name=Península, max 61kg; 39000<=ZIP<60000; 52<=Weight<=61; Shipping=23.08
Name=Península, max 71kg; 39000<=ZIP<60000; 62<=Weight<=71; Shipping=26.92
Name=Península, max 81kg; 39000<=ZIP<60000; 72<=Weight<=81; Shipping=30.77
Name=Península, max 91kg; 39000<=ZIP<60000; 82<=Weight<=91; Shipping=34.62
Name=Península, max 100kg; 39000<=ZIP<60000; 92<=Weight<=101; Shipping=38.46
Name=Spain, Weight>=102; 39000<=ZIP<60000; Shipping=38.46+(Weight-101)*0.1
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=8.65
Name=Península, max 26kg; 53000<=ZIP<99999; 22<=Weight<=26; Shipping=10.58
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.62
Name=Península, max 100kg; 53000<=ZIP<99999; 92<=Weight<=101; Shipping=38.46
Name=Spain, Weight>=102; 53000<=ZIP<99999; Shipping=38.46+(Weight-101)*0.1

Shipping rules according to weight, zip code 12 Nov 2013 01:34 #3

It's just some small changes that are needed:
1) You need to place rules with more restrictions (i.e. the balearic islands rules!) first
2) I'm not sure what you intend with the MinWeight==0 condition... That means that if any product in the order has zero weight, the shipping will be 0 (for the peninsula) or 33 (to the balearic islands). Are you (mis)using weight==0 to indicate a special type of product? Then it would make sense.

If you place the rules for Balearic islands first, the Peninsula rules will only be evaluated if none of the Balearic rules match.

To understand the logic, you need to understand that the plugin is actually quite dumb: It simple looks at the first rule, checks whether it matches and returns that shipping cost if all conditions are met (and does not look at any further rules in that case). Otherwise, it will look at the second rule and so on, until it finds a rule where all conditions are matched. None of the rules after that one will be considered.

That's the reason why you need to place rules with the most conditions first. The final rule will usually be some kind of catch-all rule.

Shipping rules according to weight, zip code 23 Nov 2013 14:38 #4

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
First f all, sorry for my delay in replying.

Manuxx, yes i am Spanish, your post has been very useful to me, muchas gracias : )

Reinhold, your solution works worderfully, thanks.

I have another doubt...is it possible to exclude an area? I mean, to prevent them from ordering, and exclude them from the shipping costs

Regards

Shipping rules according to weight, zip code 28 Nov 2013 03:46 #5

If you can describe the area to be excluded by e.g. a ZIP range, then you can simply use NoShipping to force the plugin not to offer any shipment rate for the order:
1234<=ZIP<=5678; NoShipping

Place this before the other rules, so those ZIP codes will be excluded first.

Shipping rules according to weight, zip code 28 Nov 2013 14:42 #6

  • oysterrgirl
  • oysterrgirl's Avatar Topic Author
Very nice! Thank you very much Reinhold : )

[SOLVED] Shipping rules according to weight, zip code 28 Nov 2013 14:42 #7

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