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


Stop buyers from purchase from 2 manufacturers 24 Jan 2018 22:56 #1

  • popkorn62
  • popkorn62's Avatar Topic Author
Hi Reinhold,

Thank you so much for the powerful plugin. I am still trying to make the most use out of it.

My shop has 2 vendors. Since Virtuemart has not fully developed with multi-cart options, I have to get around with shipping.
One shop - A ships from South Korea so quite expensive.
One shop - B only has some items that other shop has and ships in domestic US only.

In order to have the items from shop A goes to the correct Paypal account and charges the correct shipping fee, I set them at the correct item weight, called it "International Shipping":
For US:
0.1<=Weight<0.5; Shipping=26.5
Weight<0.75; Shipping=30
Weight<1; Shipping=33.5
Weight<1.25; Shipping=37
I have different rules for all the countries (about 12 zones in total lol)

Now shop B also has some small items that shop A has, I have to set these same items at 100kg and called the shipping rule "Shipping - Zone Special":
Name="Flat Rate"; "pcb-various-us-only" in SKUs; 100<=Weight<=200; Shipping=0
Name="Flat Rate"; "pcb-various-us-only" in SKUs; 200<Weight; Shipping=-5
Name="Flat Rate"; "switch-films-us-black" in SKUs; 100<=Weight<=500; Shipping=5
Name="Flat Rate"; "switch-films-us-black" in SKUs; 500<Weight<=900; Shipping=3
Name="Flat Rate"; "switch-films-us-black" in SKUs; 900<Weight; Shipping=0

In this case, if US people order switch films only, it will be $5/$3/$0. If they order it w/ PCBs, switch films will be free shipping. That is perfect. Please notice that these items are VERY LIGHT.

The problem is, people can still order combine items from shop A because it has the correct weight, it just falls into 110kg or 120kg and they become free shipping. I can make a rule to error out for international shoppers (easily using contains SKUs/NoShipping) but not sure how to stop US shoppers from doing that.

Now, I want to do 2 things:
1/ Offers NO SHIPPING if both items from shop A and shop B are in cart for US shoppers. I am thinking about a way with SKUs but I have tried and it did not do anything. Always ends up with free shipping or $5 (depends on which items from shop B they put in there together).
I tried: "Name=Both US Only and International products are included; evaluate_for_manufacturer(evaluate_for_categories(Articles, 8), 2)>0; NoShipping" but the cart returned "Unknown scoping function 'evaluate_for_manufacturer' encountered in rule 'Name=Both US Only and International products are included; evaluate_for_manufacturer(evaluate_for_categories(Articles, 8), 2)>0; NoShipping'"

2/ For shop A, I want to offer cheaper shipping for light items: switch films and PCBs at "Air parcel shipping". These options are only available for any items shipped from shop A and under 2kg.
=> I tried:
Name="Air Parcel"; 0.1<=Weight<0.5; Shipping=15
Name="EMS Shipping"; 0.1<=Weight<0.5; Shipping=26.5
Weight<0.75; Shipping=30
It will skip right to $30 shipping so I guess I did something wrong there?...

Can you please help me? I spent an entire day but still did not figure it out.


Stop buyers from purchase from 2 manufacturers 29 Jan 2018 02:25 #2

Dear Jade,
In Virtuemart the standard approach to distinguish certain kinds of products is to use (hidden/unpublished) categories. You can assign all products from shop A to category ShopA (say ID 42) and all products from shop B to category ShopB (say ID 43). As long as those categories are unpublished, they will not have any effect on the display, but things like shipping methods, tax calculation etc. can use them to distinguish various use cases.

1) NO SHIPPING if products from both shops are in the order:
Name=Both US Only and International products are included; Condition=contains_all(Categories, 42, 43); NoShipping

2) Do you want to let the customer choose between "Air Parcel" and "EMS shipping" for light orders? If so, you will have to set up two separate shipping methods. One shipping method can only offer one rate.
If you want to offer Air parcel shipping only for orders that contain only items from Shop A and have a total weight up to 2kg, the corresponding rule (in the method for "Air parcel shipping') is:
Weight<=2; Condition=contains_none(Categories, 43); Shipping=15
The contains_none call returns true only when no product from Category 43 (i.e. ShopB) is in the order.

Best regards,

Stop buyers from purchase from 2 manufacturers 29 Jan 2018 08:36 #3

  • popkorn62
  • popkorn62's Avatar Topic Author
Hi Reinhold,

Thank you! Your 1) worked perfectly. However, at the same time, I cannot publish my previously mentioned weight-based rule for US customers:

So I created another Category: "US Store Peripherals" & "US Store Heavy", then I changed the product weight to their actual weight and created another rule (clone shipment) I JUST REALIZED THEY JUST NEEDED TO BE IN THE SAME RULE LOL:
Name="US Shipping only"; Weight<=0.5; Condition=contains_any(Categories, 7, 9, 10); Shipping=5
Name="US Shipping only"; 0.5<Weight<=1; Condition=contains_any(Categories, 7, 9, 10); Shipping=7.5
Name="US Shipping only"; 1<Weight<=2; Condition=contains_any(Categories, 7, 9, 10); Shipping=12.5
Name="EMS Shipping"; 0.1<=Weight<=0.5; Condition=contains_only(Categories, 8, 11); Shipping=26.5
Name="EMS Shipping"; 0.5<Weight<=0.75; Condition=contains_only(Categories, 8, 11); Shipping=30
Name="EMS Shipping"; 0.75<Weight<=1; Condition=contains_only(Categories, 8, 11); Shipping=33.5

US = Cat 7
SK = Cat 8
US Peripherals = Cat 9
US Heavy = Cat 10
SK Peripherals = Cat 11

I then republished the NoShipping for multi-carts. Here are the scenarios:

a. If I tried to put 2 products from both shops, there is $5 shipping while it should be no shipping offered. Error still shows so that's good.
b. If I put a products from cat 7, it shows $5 shipping which is correct.
c. If I put a product from cat 8, it shows $26.5 which is correct.

I just had a duh moment, here's what I fixed for US customers to work:
Name="US Shipping only"; Weight<=0.5; Condition=contains_none(Categories, 8); Shipping=5
Name="US Shipping only"; 0.5<Weight<=1; Condition=contains_none(Categories, 8); Shipping=7.5
Name="US Shipping only"; 1<Weight<=2; Condition=contains_none(Categories, 8); Shipping=12.5
Name="EMS Shipping"; 0.1<=Weight<=0.5; Condition=contains_none(Categories, 7); Shipping=26.5
Name="EMS Shipping"; 0.5<Weight<=0.75; Condition=contains_none(Categories, 7); Shipping=30
Name="EMS Shipping"; 0.75<Weight<=1; Condition=contains_none(Categories, 7); Shipping=33.5

Now I just need to know why options for different shipping doesn't show up.

[SOLVED] Stop buyers from purchase from 2 manufacturers 06 Feb 2018 07:26 #4

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