This project aims to be a library of Rules events, conditions and actions for Drupal Commerce.
My wish is to merge all modules based on Rules and Drupal Commerce in a single one.
It is a fork of Commerce Extra Rules Conditions which seems not to be maintained.
Any contribution is welcome, maintainers too !
This module currently provides :

  • Rules events
    • Process checkout pane : Fires when a pane is processed during checkout process
    • Line item quantity has changed (occurs when adding ou removing a product to cart and when a quantity has been modified in cart form).
  • Rules conditions
    • Line item product has term : Test if a line item has a product with a specified term
    • Line item product has terms : Test if a line item has a product with one or all specified terms
    • Total product with term quantity comparison : Total of products with term and with a specified quantity
    • Total product of type quantity comparison : Total of products of specified type and with a specified quantity
    • Total product of type amount comparison : Total of products of specified type and with a specified amount
  • Rules actions
    • Change pane properties : Change visibility, page, weight of a pane
    • Get the referencing node from the line item : Set the referenced node (product display) into a variable to be reused in another action

Example

With this module, you can alter visibility of a pane "Billing informations" if order has a product of type MyProduct.
Create a new rule with :

  1. Event : Select "Process checkout pane"
  2. Condition : Add "Total product of type quantity comparison" condition and choose "MyProduct" as product type". Set ">=" as operator and 1 as quantity
  3. Action : add "Change pane properties" and select "Billing informations" as pane, and uncheck "Enabled"

Now billing informations pane won't be shown if the order has a product of type MyProduct.

Version 2.x

Version 2 has the same functionnalities but total comparaison (quantity and amount) now can be done by term(s) and/or by product type. Terms selection is done by ajax.
These conditions have been renamed to Total amount of selected products comparison and Total quantity of selected products comparison.
Line item product has term has been merged into Line item product has terms too.
See #2059325: Features of version 2
for new features and changes.