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


Can I do this? 30 Jan 2015 08:33 #1

  • ex3mist
  • ex3mist's Avatar Topic Author
I couldn't find the information I need so I'd like to ask you if your plugin meet my demands.
For example:
I have three types of products - A, B and C.
For type A the standart shipping rules are applied - cost is defined by weight.
Type B products have lower shipping cost and it is fixed for a certain products or the category they are in, no matter the weight. If you put products A+B in the cart, the shipping cost is standart - from product A, e.g. the higher cost is shown.
Type C products also have fixed cost, but it is higher than the standart and no matter how many pcs. of it you put in the cart, it is the same. If you put in the cart products A+B+C, A+C or B+C, the cost of the type C products is shown, no matter the weight or the number of products.

I'll be glad if you can give me answers to my questions and if I can read some more information about it, it would be gret. Thanks!

Can I do this? 09 Feb 2015 22:50 #2

Basically, your rules would have the following logic:
1) If any product of type C is in the order, offer the higher (fixed) rate.
2) Otherwise, if any product of type A is in the order, offer the standard rate based on weight.
3) Otherwise (i.e. no type A or C products), offer the lowest shipping rate.

The details depend on how you distinguish Type A, B and C products. Do you use categories?

If so, the rules could look something like this (the 123 etc. are example category IDs and would need to be adjusted to your setup):
Name=Flat rate (high); contains_any(Categories, 123, 124, 125); Shipping=75
Name=Standard rate (weight-based); contains_any(Categories, 150, 151); Shipping=Weight*2
Name=Flat rate (low); Shipping=1

If product type A is defined as anything other than e.g. Categories 123 (type C) and Categories 190 and 191 (type B), then the rules would be:
Name=Flat rate (high); contains_any(Categories, 123); Shipping=75
Name=Flat rate (low); contains_only(Categories, 190, 191); Shipping=1
Name=Standard rate (weight-based); Shipping=Weight*2

Notice that in this case, the logic is a bit different:
-) If any product of type C (category 123) is in the order, the rate is 75
-) If the order contains only type B (no A or C, i.e. only categories 190 and 191), shipping is 1
-) In all other cases (no type C product, but at least one non-B product) we applyo the standard weight-based rate.

If you need to check individual product SKUs, that is possible, too. Just use the SKUs list variable instead of Categories. You can also combine those checks with " OR ".

Best regards,

Can I do this? 11 Feb 2015 08:10 #3

  • ex3mist
  • ex3mist's Avatar Topic Author
Hello reinhold,
And thank you for the detailed explanation. That was what I've been hoping for. If I have further questions I'll write again, but for now this answers my previous questions.

Have a good day!

[SOLVED] Can I do this? 20 Feb 2015 17:57 #4

Problem solved.

Can I do this? 13 Jun 2015 15:37 #5

  • ex3mist
  • ex3mist's Avatar Topic Author
I've just purchased the Advanced Shipping by Rules plugin and tried to apply it, but something is not OK.

The rules I'm using are:
contains_only(Categories, 37); Articles==1; Shipping=1.99
contains_any(Categories, 36); Shipping=15

The logic is as follows:

If only products from category 37 is in the cart, and it is only 1 pc, the shipping is 1.99 euro.
If there is a product from category 36 in the cart, regardless of the other products and their number, the shipping is 15 euro.
In all the other cases - the shipping is 6.50 euro.

I guess I'm not making a mistake about it and it is correct? Yes, but it is not working! The result is: If 1 product is in the cart, no matter what category, even from 36 or 37, the shipping is 1.99 euro. If I put another product in the cart, the shipping becomes 15 euro. I've tried different combinations, but it is always the same. Tried to find out if I've made a mistake, a typo.. whatever, it is the same. In the first case the first rule is executed, if the products are 2 or more, the second rule. The third rule is not executed at all.

Can you please, point what am I doing wrong so that the rules are not working correct?

Can I do this? 13 Jun 2015 15:41 #6

Dear Ex3mist,
Does it work, if you prepend "Condition=" before the contains_only/contains_any calls? In particular, the plugin sometimes is not smart enough to determine which rule part is a condition and which is the shipping cost. to a computer, the contains_only function simply has a value of 0 or 1, so theh plugin wrongly detects this as shipping costs.
Pleas try these rules:
Condition=contains_only(Categories, 37); Articles==1; Shipping=1.99
Condition=contains_any(Categories, 36); Shipping=15

Best regards,

[SOLVED] Can I do this? 13 Jun 2015 15:48 #7

  • ex3mist
  • ex3mist's Avatar Topic Author
Yeeeeessss!!! It is working now. Thank you very much for the fast response! Great support!

Have a great day!
  • Page:
  • 1