Quadra_ConditionalAction

Magento Extension
Download latest - 1.0.0

Developers

Enable conditional action (link) in backoffice Grid class with adding a condition lign like :
array(
'caption' => Mage::helper('sales')->__('Print'),
'url' => array('base'=>'*/*/print'),
'field' => 'order_id',
'condition' => array('data' => 'status', 'operator' => 'eq', 'value' => 'processing'),
)

Releases (1)

Date Version Notes
2009-11-12 1.0.0

This extension allows backoffice developers to add, on Grid, actions (links) that display only according to a condition.
Example : on the orders list, you can add an "print" action that displays only on ligns with orders in "complete" status.

To do that, you have to add a lign "condition" in the array, when declaring the action.
Example :
array(
'caption' => Mage::helper('sales')->__('Print'),
'url' => array('base'=>'*/*/print'),
'field' => 'order_id',
'condition' => array('data' => 'status', 'operator' => 'eq', 'value' => 'processing'),
)

The "operator" lign can have several values :
eq (or ==) : equal
neq (or !=) : not equal
gt (or >) : greater than
lt (or =) : greater than or equal
lteq (or <=) : lesser than or equal

This extension also allows to display several actions (links) lign per lign instead of in a select tag.
The "type" attribute of the column must be "multipleaction" instead of "action".