You are here

function commerce_product_bundle_rules_action_info in Commerce Product Bundle 7

Same name and namespace in other branches
  1. 7.2 commerce_product_bundle.rules.inc \commerce_product_bundle_rules_action_info()

Implements hook_rules_action_info().

File

./commerce_product_bundle.rules.inc, line 43
Rules integration for product bundle.

Code

function commerce_product_bundle_rules_action_info() {
  $actions = array();
  $actions['commerce_product_bundle_calculate_price'] = array(
    'label' => t('Calculate the price of a bundle product'),
    'parameter' => array(
      'commerce_line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Line item'),
      ),
      'multiply_by_quantity' => array(
        'type' => 'boolean',
        'label' => t('Multiply by Quantity'),
        'description' => t('Should the price be multiply by the added quantity of the sub product.'),
      ),
    ),
    'group' => t('Commerce Product Bundle'),
  );
  $actions['commerce_product_bundle_set_price'] = array(
    'label' => t('Set the price of a sub bundle.'),
    'parameter' => array(
      'line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Sub line item'),
      ),
      'amount' => array(
        'type' => 'decimal',
        'label' => t('Amount'),
      ),
    ),
    'group' => t('Commerce Product Bundle'),
  );
  $actions['commerce_product_bundle_load_sub_items'] = array(
    'label' => t('Load Sub Line Items.'),
    'parameter' => array(
      'line_item' => array(
        'type' => 'commerce_line_item',
        'label' => t('Sub line item'),
      ),
    ),
    'provides' => array(
      'sub_line_items' => array(
        'type' => 'list<commerce_line_item>',
        'label' => t('sub line items'),
      ),
    ),
    'group' => t('Commerce Product Bundle'),
  );
  return $actions;
}