VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Shipping by Rules for VirtueMart
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