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: Multiple rules one cart

Multiple rules one cart 13 Jun 2018 21:47 #1

  • jfreak53
  • jfreak53's Avatar Topic Author
  • Offline
  • Posts: 2
I'm trying to apply multiple rules to a single cart, I'm not having much luck.

This is my current ruleset:
Variable=myShip; Value=7.50*evaluate_for_categories(articles, 46)
Variable=myShip; Value=0.50*evaluate_for_categories(Articles, 43, 44, 45)
Shipping=myShip

If I remove the second rule, then the first works good. But I cannot get it to work with the multiple rules.

Basically each product for category 46 I want it to add $7.50, and each product/qty for the other 3 categories I want it to add $0.50 per product.

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

Multiple rules one cart 13 Jun 2018 22:14 #2

Dear JFreak53,
1. Your "problem" is that the second line OVERWRITES the value of myShip, it does not automatically ADD. So your correct rules would be
Variable=myShip; Value=7.50*evaluate_for_categories(articles, 46)
Variable=myShip; Value=myShip + 0.50*evaluate_for_categories(Articles, 43, 44, 45)
Shipping=myShip

2. As long as you have such simple rule sets, you can easily combine all of them into one calculation
Shipping=7.50*evaluate_for_categories(articles, 46) + 0.50*evaluate_for_categories(Articles, 43, 44, 45)

Best regards,
Reinhold

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

  • Page:
  • 1

VM - Shopping cart

 x 

Cart empty

Login Formular