Shipping By Rules for WooCommerce
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Confirming for Categories

Confirming for Categories 09 Jan 2018 17:46 #1

I am trying to develop a pricing algorithm for pricing the shipping of our literature. We have both eLiterature where no shipping is applied and printed literature where we want shipping applied. Both eLiterature and Printed Literature are categories within WooCommerce.

Based on another post I developed this string: Name="Shipping $;evaluate_for_categories(Articles, "Printed Literature");Amount<=24.99;shipping=Amount*.30

Would this be correct to total the amounts for everything categorized as "Printed Literature" and price the shipping at 30% of that amount?

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

Confirming for Categories 28 Jan 2018 19:10 #2

Dear Carolyn,
Your rule is a good start, but not entirely correct. To charge shipping costs of 30% of the order total of the "Printed Literature" category (and ignore all other products), the proper rule would be:
Name="Shipping $$; ;Amount<=24.99;shipping=evaluate_for_categories(Amount, "Printed Literature")*.30
Do you want to apply the condition "up to 25$" to the order total of the printed literature category, too, or shall that condition apply on the total order amount of all products? The rule I gave applies the condition to the overall order total including all products. If you want that condition only for the printed literature, simply replace Amount by evaluate_for_categories(Amount, "Printed Literature")

Quick explanation: You seem to expect evaluate_for_categories to limit all variables in the rule to the given categories, which is NOT what that function does. It is not an indicator how the rest of the rule shall be evaluated, but it evaluates the variable given (in your example rule "Articles") only for the given categories and returns the value.
Best regards,

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

  • Page:
  • 1

VM - Shopping cart


Cart empty

Login Formular