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


complex shipping method 13 Dec 2015 16:36 #1

  • cameroncoop
  • cameroncoop's Avatar Topic Author
Hi there, I am trying to apply the following method without success, please assist me?


Here is what I am using for example:

R70.00 up to 2 Kg , extra kg R35

Name=Pretoria; weight<2; Shipping=70+amount*0.35*weight

It does not work, the link above is to a product with a weight in Kilogram of 0.2580

VirtueMart 2.6.14
PHP 5.4.39
Joomla! 2.5.28 Stable [ Ember ]

This does work using the plugin though, so it seems to be functioning..
Name=normal; Shipping=10;

complex shipping method 13 Dec 2015 17:24 #2

Dear cameroncoop,
A shipping cost structure of R70 for the first 2kg and R35 for each extra kg can be implemented with the following rule (needs the advanced version of the plugin):
Name=Pretoria; Shipping=35*max(2,ceil(weight))
Explanation: each full kg is R35, so we need to round the weight up to the next full kg using ceil(weight). Additional, at least 2kg are charged in any case, so we use max(2, ...) to use at least 2kg.
There is no need to use amount (the order total amount) in the formula.

Best regards,

complex shipping method 14 Dec 2015 22:00 #3

  • cameroncoop
  • cameroncoop's Avatar Topic Author
Hi there,

I am using the PRO version of this plugin! :)

Thank you for the reply! How do I add the initial R70 cost and then an extra 35 per addition KG ?

Thanks for your help!!

Kind Regards,

complex shipping method 14 Dec 2015 22:31 #4

  • cameroncoop
  • cameroncoop's Avatar Topic Author
I have tested this product using :
Name=Pretoria; Shipping=35*max(2,ceil(weight))

On this page:

The result is 70 but nothing more when I increase the quantity, I am unsure on what to do for this..

Kind Regards,

complex shipping method 30 Dec 2015 14:12 #5

Dear Carmeron,
What is the exact weight of the item? It might be that the weight units are wrong and thus the total weight of the order always stays below 2.
For testing purposes, I would temporarily append the weight to the shipping name:
Name=Pretoria (Weight={weight}); Shipping=35*max(2,ceil(weight))
That will print the weight in parentheses, so you can check whether the weight is correctly calculated. If the weight is off by one or more orders of magnitude (i.e. 0.002 instead of 2kg), then you need to check whether the VM configuration, the product details and the plugin configuration have the correct weight units set.

Best regrads,
  • Page:
  • 1