VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

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!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Exclude weight 09 Jul 2017 20:50 #1

  • panosjules
  • panosjules's Avatar Topic Author
  • Offline
  • Posts: 1
Hello, i am trying to implement the following:
When only item from Manufacturer 11 is on cart then shipping is 0
When only item from Manufacturer 9 is on cart and the price is bigger than 25 (of that product, not the entire order) then shipping is 0
When both of the above only the shipping is also 0
If i have other products also in the basket then it should just remove the weight of the above products and continue weight based calculation.

What i created so far...

Name=Offer A; evaluate_for_manufacturers(Articles, 11)==Articles; Shipping=0
Name=Offer B; evaluate_for_manufacturers(Articles, 9)==Articles; 25<=Amount; Shipping=0
0.1<=Weight<=2000; Shipping=2
2001<=Weight<=3000; Shipping=2.8
3001<=Weight<=4000; Shipping=3.6
4001<=Weight<=5000; Shipping=4.4
5001<=Weight<=6000; Shipping=5.2
6001<=Weight<=7000; Shipping=6.0
7001<=Weight<=8000; Shipping=6.8

As you notice, i havent found out how to exclude the weight or if i have both manufacturers.

Any help really appreciated!
Thank you

Please Log in or Create an account to join the conversation.

Exclude weight 15 Jul 2017 18:11 #2

Dear Panosjules,
If I understand you correctly, you want to base all the weight conditions of the third and subsequent rules on the weight excluding categories 9 and 11. In that case, you can simply use a custom variable that calculates the weight of the order excluding categories 9 and 11. You would then use that custom variable instead of the Weight variable in your conditions:
Name=Offer A; evaluate_for_manufacturers(Articles, 11)==Articles; Shipping=0
Name=Offer B; evaluate_for_manufacturers(Articles, 9)==Articles; 25<=Amount; Shipping=0
Variable=myWeight; Value=Weight-evaluate_for_manufacturers(Weight, 11, 9)
0.1<=myWeight<=2000; Shipping=2
2001<=myWeight<=3000; Shipping=2.8
...

What is not handled by this code yet is the case when articles from manufacturers 9 and 11 are in the cart, but no other products (you'll add an additional rule after the first two rules to handle this case graciously.

Also,your second case (only items from manufacturer 9 with price above 25) is not entirely clear to me. If a customer buys two products from manufacturer 9, do you want to give free shipping only to individual products that cost more than 25, or is is sufficient if the customer buys articles worth at least 25 from manufacturer 9? The first case would be quite hard to solve, as our plugin does not allow conditions on individual products.
In the second case, you need to replace 25<=Amount by 25<=evaluate_for_manufacturers(Amount, 9) to implement your third rule (with products from manufacturers 9 and 11.

Also, should all products from manufacturers 9 be excluded for mixed carts, or do you only want to exclude them if the price of products from manufacturer 9 is above 25? In the latter case, you'll need to add an additional condition in the definition of myWeight to exclude products from manuf 9 only if that additional condition is fulfilled.

Best regards,
Reinhold

Please Log in or Create an account to join the conversation.

  • Page:
  • 1

VM - Shopping cart

 x 

Cart empty

Login Formular