You are here

function uc_taxes_ca_action in Ubercart 6.2

Implements hook_action_info().

File

uc_taxes/uc_taxes.ca.inc, line 48
This file contains the Conditional Action hooks and functions necessary to make the tax related entity, conditions, events, and actions work.

Code

function uc_taxes_ca_action() {
  $actions = array();

  // Loop through all the defined tax rates.
  foreach (uc_taxes_rate_load() as $rate) {
    $actions['uc_taxes_action_apply_tax_' . $rate->id] = array(
      '#title' => t('Apply !name', array(
        '!name' => $rate->name,
      )),
      '#category' => t('Taxes'),
      '#callback' => 'uc_taxes_action_apply_tax',
      '#arguments' => array(
        'order' => array(
          '#entity' => 'uc_order',
          '#title' => t('Order'),
        ),
        'tax' => array(
          '#entity' => 'tax',
          '#title' => t('Tax'),
        ),
      ),
    );
  }
  return $actions;
}