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


NEW CONDITION 20 Mar 2015 23:09 #1

  • garces0209
  • garces0209's Avatar Topic Author
hello i bought this plugin but i need different condition in my plugin.
can you help me?

i need the minimum price of shipping $15.000 always...
and this other condition:


can you help me?

NEW CONDITION 22 Mar 2015 13:22 #2

So, you want the shipping cost to be 0.08*Amount, but at least 15$ (i.e. the shipping cost is either 15 or 0.08*Amount, whichever is greater)? That can be easily done:
Amount>100; Shipping=max(15, 0.08*Amount)

Best regards,

NEW CONDITION 20 Apr 2015 16:45 #3

  • garces0209
  • garces0209's Avatar Topic Author
I need exactly this:

when the total value is less than 200,000 shall shipping cost 15.000

when the total value is greater than 200,000 and less than 1,000,000 shipping should cost = TOTAL VALUER * 7%

when the total value is greater than 1.000.000 shipping should cost = TOTAL VALUER * 8%


NEW CONDITION 20 Apr 2015 17:05 #4

Thank you for the clarification. The only thing that is not fully specified is the shipping costs when the order total is exactly 200.000 or exactly 1.000.000. I.e. should an order of order total 200.000 use shipping costs 15.000 (first case) or 14.000 (second case: 7% of 200.000), and should an order of 1.000.000 have shipping cost 70.000 (7%) or 80.000 (8%)?
In the following, I assume that orders of 20.000 get 7% and orders of exactly 1.000.000 get 8%. If you want it the other way round, simply exchange all < by <= (and vice versa) in the following rules.

The proper rules for your shipping cost structure are:
Amount<200000; Shipping=15000
Amount<1000000; Shipping=Amount*0.07

Please notice that in these rules, I implicitly used the fact that the plugin uses the first rule that matches. So the second rule (the 7%) will only be considered, when the first rule did not match. So in the second rule we can safely assume that Amount<20000 is not true, so I did not repeat this check. On the other hand, this means that you cannot change the order of the rules.

You can also add the lower bound to the rules with the exact same result:
Amount<200000; Shipping=15000
200000<=Amount<1000000; Shipping=Amount*0.07
1000000<=Amount; Shipping=Amount*0.08

Notice that here the lower bound needs to be checked using <= (including the = sign!), otherwise an Order of 200000 would not get any shipping offered.

Best regards,
  • Page:
  • 1