You are here

function uc_taxes_get_rates in Ubercart 5

Load all tax rates.

5 calls to uc_taxes_get_rates()
hook_calculate_tax in docs/hooks.php
Calculate tax line items for an order.
uc_taxes_calculate_tax in uc_taxes/uc_taxes.module
Calculate the amount and types of taxes that apply to an order.
uc_taxes_configuration in uc_taxes/uc_taxes_workflow.inc
Implementation of hook_configuration().
uc_taxes_event_info in uc_taxes/uc_taxes_workflow.inc
Implementation of hook_event_info().
uc_taxes_update_6 in uc_taxes/uc_taxes.install

File

uc_taxes/uc_taxes.module, line 420

Code

function uc_taxes_get_rates() {
  static $taxes = array();
  if (empty($taxes)) {
    $result = db_query("SELECT * FROM {uc_taxes} ORDER BY weight");
    while ($rule = db_fetch_object($result)) {
      $rule->taxed_product_types = unserialize($rule->taxed_product_types);
      $rule->taxed_line_items = unserialize($rule->taxed_line_items);
      $taxes[$rule->id] = $rule;
    }
  }
  return $taxes;
}