2

My store sells heavy and lightweight widget items. I currently have 1 product type and have 1 term reference field that designates it as either light weight or heavy weight

Now in my flat rate shipping setup. I have 2 flat rate prices. One for light and heavy. I add a condition to each of these shipping methods to check if its either a light or heavy object, but I'm not sure how I can retrieve these taxonomy references in the rules setup of the component. I would imagine i would have to do a commerce_order:line-item, but after that im stuck and not sure where to go to grab the taxonomy terms.

enter image description here

2

In addition to Nigel's answer, the modules we would need to use is this:

https://drupal.org/project/commerce_rules_extra

Its a more upto date and maintained module than extra_rules_condition

Here's a screen shot of what gets added on the add component option in the rules dropdown. From this:

Before rules extra is installed To this:

As we can see more rule options are added

2

Use the Commerce Extra Rules Condition module:

The module adds additional Rules conditions related to Drupal Commerce.

It currently adds:

  • A condition for checking if a line item references a product with a specified Taxonomy term applied to it.
  • A condition for checking if a line item references a product with specified Taxonomy terms applied to it.
  • A condition for comparing the quantity of products in an order with a specified Taxonomy term applied to them against a specified value.
  • A condition for comparing the quantity of products in an order of a specified product type or checking the quantity of products in an order excluding a specified product type.
    • That's bloomin' awesome, wish I'd heard of that one before - I just spent 10 minutes writing a code solution :P – Clive Aug 2 '13 at 17:38
    • seems that extra rules condition has a more updated version: drupal.org/project/commerce_rules_extra --- its more upto date and maintained. – Patoshi パトシ Aug 2 '13 at 17:47
    • @duckx That's even awesomer! You should put that in as a separate answer so it gets visibility, I can see a lot of people finding that one useful – Clive Aug 2 '13 at 17:53
    • Even better. I knew there was a more recent updated version that I had kept in the back of my mind to be used when I needed it, but in my search all I found was this one. – Nigel Waters Aug 2 '13 at 17:57
    0

    A friend of mine had the same problem half year ago. I created a simple module that allowed you to select terms out of taxonomy vocabs and use them for conditions.

    The module checks the taxonomy terms in both the commerce product and the node attached to the commerce product.

    commerce taxonomy conditions

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

    Not the answer you're looking for? Browse other questions tagged or ask your own question.