uc_taxes.rules_defaults.inc 645 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the default Rules configurations that allow conditions to
  5. * be applied to taxes.
  6. */
  7. /**
  8. * Implements hook_default_rules_configuration().
  9. *
  10. * Creates a condition set for each tax rule.
  11. */
  12. function uc_taxes_default_rules_configuration() {
  13. $configs = array();
  14. // Loop through all the defined tax rates.
  15. foreach (uc_taxes_rate_load() as $rate) {
  16. $set = rules_and(array(
  17. 'order' => array('type' => 'uc_order', 'label' => 'Order'),
  18. ));
  19. $set->label = t('@name conditions', array('@name' => $rate->name));
  20. $configs['uc_taxes_' . $rate->id] = $set;
  21. }
  22. return $configs;
  23. }