You are here

function uc_taxes_configuration in Ubercart 5

Implementation of hook_configuration().

Create a configuration for each event corresponding to a tax rule.

File

uc_taxes/uc_taxes_workflow.inc, line 150
This file contains the Workflow-ng hooks and functions necessary to make the tax related entity, conditions, events, and actions work.

Code

function uc_taxes_configuration() {
  $configurations = array();
  $taxes = uc_taxes_get_rates();
  foreach ($taxes as $tax) {
    $configurations['uc_taxes_' . $tax->id] = array(
      '#label' => $tax->name,
      '#event' => 'calculate_tax_' . $tax->id,
      '#module' => 'uc_taxes',
      '#active' => true,
    );
    $action = workflow_ng_use_action('uc_taxes_action_apply_tax', array(
      '#label' => t('Apply @tax', array(
        '@tax' => $tax->name,
      )),
    ));
    $configurations['uc_taxes_' . $tax->id] = workflow_ng_configure($configurations['uc_taxes_' . $tax->id], $action);
  }
  return $configurations;
}