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!



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


Incremental price on every 6 articles 29 Jan 2015 03:40 #1

  • madcowinc
  • madcowinc's Avatar Topic Author
Hi reinhold, I just got the advanced version of the plugin, It is awesome btw!

I would like to ask your help about a few questions.

I need to have an initial Shipping price of 6$ for the first 6 articles, after that I need to increase the price for every 6 for example

0-6 articles shipment = 6$
7-12 articles shipment = 12$
13-18 articles shipment = 18$
19-24 articles shipment = 24$

this should be calculated according to the number of articles dynamically.

2) Is there a way to display the total Shipping in the name label?

Something like this

Name=Postage ({shipment}$); ZIP==4 ; Shipping=12*articles

3) If I have 3 possible shipments lets say:

Name=Shipment 1; ZIP==4 ; Shipping=12
Name=Shipment 2; ZIP==5 ; Shipping=14
Name=Shipment 3; ZIP==6 ; Shipping=15
Name=No Shipping available, please check your Shipment Addresses; NoShipping

And none of the first get selected, how do I force to display the NoShipping last rule?, actually in my example it is selecting shipment 3 if I set zipcode to 9

Thank you!

Incremental price on every 6 articles 30 Jan 2015 00:18 #2


1) Basically you want the shipping costs to be 1$ per article, rounded up to the next multiple of 1. So one potential rule (there is not one correct way, but many right ways that yield the correct result):
Shipping=1*ceil(Articles, 6)
The 1* is there just to indicate where you would modify the rule if you want e.g. 2$/article.
This approach uses the feature of the ceil/floor/round functions to specify the unit to round to. In our case, you want the Articles variable to be rounded up to the next multiple of 6, so you give 6 as the second argument to the ceil function.

2) This is currently not possible. I have put it on my list of potential future features, but I can't promise when or even if I will ever implement this.

3) When None of the first three rules match, then the NoShipping rule will automatically apply. For a zip code of 9, Shipment 3 should definitely NOT match. What are your exact rules?

Best regards,

Incremental price on every 6 articles 30 Jan 2015 01:27 #3

  • madcowinc
  • madcowinc's Avatar Topic Author
Hi reinhold, thank you for your support.

1) No it is not what I mean, let me explain better:

I will sell bottles,

so from 0 bottles to 6 bottles shipping should be 6$ (it is not 1$ per bottle it could be 8$ or any amount)
from 7 to 12 should be 12$ so the price should increase per 6 bottles this is because I can put only 6 bottles in a box, y the user select 7 bottles I have to use two boxes so I need to charge 12$ (two boxes) if the user selects <=12 bottles it should be 12$ because 12 bottles fit in two boxes, but 13 bottles needs 3 boxes, and so on

2) :( this could be something very useful when the price is not fixed and calculated dinamicaly

3) I just create a new shipment with a clean set of rules and it worked as expected, something should be wrong in my rules

Name=Please enter a valid ZIP to get a shipping rate; ZIP<=0; NoShipping
Name=Sydney Metro; 1000<=ZIP<=2249 OR 2555<=ZIP<=2574 OR 2740<=ZIP<=2786 OR ZIP==2890 ;Shipping=8*ceil(Articles, 8)
Name=Gosford; 2250<=ZIP<=2263 ;Shipping=7
Name=Newcastle; 2282<=ZIP<=2310;Shipping=7
Name=Wollongong; 2500<=ZIP<=2506 OR 2515<=ZIP<=2530; Shipping=7
Name=Canberra; 0200<=ZIP<=0299 OR 2600<=ZIP<=2620 OR 2900<=ZIP<=2920 ; Shipping=10
Name=NSW Country; 2264<=ZIP<=2281 OR 2311<=ZIP<=2499 OR 2507<=ZIP<=2514 OR 2531<=ZIP<=2554 OR 2575<=ZIP<=2599 OR 2621<=ZIP<=2639 OR 2642<=ZIP<=2739 OR 2787<=ZIP<=2889 OR 2891<=ZIP<=2898; Shipping=9
Name=Norfolk Island; ZIP==2899 ;Shipping=10
Name=Melbourne Metro; 3000<=ZIP<=3210 OR 3335<=ZIP<=3341 OR 3425<=ZIP<=3443 OR 3750<=ZIP<=3811 OR 3910<=ZIP<=3920 OR 3926<=ZIP<=3944 OR 3972<=ZIP<=3978 OR 3980<=ZIP<=3983 OR 8000<=ZIP<=8999 ;Shipping=6
Name=Geelong; 3211<=ZIP<=3220 ;Shipping=10
Name=Ballarat; 3353<=ZIP<=3356 OR ZIP==3350; Shipping=12
Name=Vic Country; 2640<=ZIP<=2641 OR 3221<=ZIP<=3334 OR 3342<=ZIP<=3349 OR 3351<=ZIP<=3352 OR 3357<=ZIP<=3424 OR 3444<=ZIP<=3749 OR 3812<=ZIP<=3909 OR 3921<=ZIP<=3925 OR 3945<=ZIP<=3971 OR 3984<=ZIP<=3999 OR ZIP==3979 ; Shipping=11
Name=Brisbane Metro; 4000<=ZIP<=4209 OR 4500<=ZIP<=4549 OR 4900<=ZIP<=4999 OR 9000<=ZIP<=9999;Shipping=8
Name=Gold Coast; 4210<=ZIP<=4229;Shipping=9
Name=Ipswich; 4300<=ZIP<=4307 ; Shipping=12
Name=Sunshine Coast; 4550<=ZIP<=4575 ; Shipping=12
Name=QLD Country South; 4230<=ZIP<=4299 OR 4308<=ZIP<=4499 OR 4576<=ZIP<=4689 ; Shipping=12
Name=QLD Country North; 4690<=ZIP<=4899 ; Shipping=25
Name=Adelaide Metro; 5000<=ZIP<=5199 OR 5800<=ZIP<=5999 ; Shipping=10
Name=SA Country; 5200<=ZIP<=5749 ; Shipping=12
Name=Perth Metro; 6000<=ZIP<=6214 OR 6800<=ZIP<=6999 ; Shipping=30
Name=WA Country Near; 6215<=ZIP<=6699 ; Shipping=44
Name=WA Country Far; 6700<=ZIP<=6790 ; Shipping=44
Name=WA External Territory; 6798<=ZIP<=6799 ; Shipping=45
Name=Tasmania; 7000<=ZIP<=7150 OR 7152<=ZIP<=7999 ; Shipping=20
Name=Australian Antartic Territory; ZIP==7151 ; Shipping=45
Name=Northern Territroy Near; 0800<=ZIP<=0821 OR 0828<=ZIP<=0851 OR 0860<=ZIP<=0861 OR 0870<=ZIP<=0871 OR 0887<=ZIP<=0999 OR ZIP==0853 ; Shipping=37
Name=Northern Territroy Remote; 0822<=ZIP<=0827 OR 0852 OR 0854<=ZIP<=0859 OR 0862<=ZIP<=0869 OR 0872<=ZIP<=0886 ; Shipping=54
Name=No Shipping available, please check your Shipment Addresses; NoShipping

If I set zipcode 999999999 it always return "Northern Territroy Remote" rule

Incremental price on every 6 articles 09 Feb 2015 22:23 #4

1) Thanks for the further explanation. This was exactly what I tried to say (I mistyped and wrote "multiple of 1" in the first line, while it should have been "multiple of 6"):
Shipping=1*ceil(Articles, 6)

On the other hand, you can also calculate the number of boxes ("ceil(Articles/6)") and multiply with 6:

3) In the "Northern Territory Remote" (note the typo: "Territroy") rule you have "... OR 0853 ...". I suppose you are missing a "ZIP=="?
Without the ZIP==, the 0853 will be interpreted by the computer as true (to a computer, all comparisons and conditions are just functions that have the value 0 or a non-zero value. Non-Zero means True, Zero means false. So "0853" on its own means "True" and thus the rule matches always...

Best regards,
  • Page:
  • 1