You are here

function uc_taxes_default_rules_configuration in Ubercart 7.3

Implements hook_default_rules_configuration().

Creates a condition set for each tax rule.

File

uc_taxes/uc_taxes.rules_defaults.inc, line 13
Default Rules configurations for uc_taxes.

Code

function uc_taxes_default_rules_configuration() {
  $configs = array();

  // Loop through all the defined tax rates.
  foreach (uc_taxes_rate_load() as $rate) {
    $set = rules_and(array(
      'order' => array(
        'type' => 'uc_order',
        'label' => 'Order',
      ),
    ));
    $set->label = t('@name conditions', array(
      '@name' => $rate->name,
    ));
    $configs['uc_taxes_' . $rate->id] = $set;
  }
  return $configs;
}