You are here

function hook_commerce_tax_type_info in Commerce Core 7

Defines tax types used to categorize tax rates.

Return value

An array of information about tax types available for use by rates. The returned array should be an associative array of tax type arrays keyed by the tax type name. Each tax type array can include the following keys:

  • title: the title of the tax type; must be defined
  • display_title: a display title for the tax type suitable for presenting to customers if necessary; defaults to the title
  • description: a short description of the tax type
  • display_inclusive: boolean indicating whether or not prices containing this tax will include the tax amount in the displayed price; defaults to FALSE
  • round_mode: integer indicating how taxes of this type should be rounded after calculation using one of COMMERCE_ROUND_NONE (default), COMMERCE_ROUND_HALF_UP, COMMERCE_ROUND_HALF_DOWN, COMMERCE_ROUND_HALF_EVEN, or COMMERCE_ROUND_HALF_ODD; these constants are similar to those used by the round() function in PHP 5.3+
  • rule: name to use for a default product pricing rule that calculates taxes of this type for line items; defaults to 'commerce_tax_type_[name]' but can be set to NULL to not create any default Rule. If the tax type name is longer than 46 characters, it must have a rule name set here that is 64 characters or less.
  • admin_list: boolean defined by the Tax UI module determining whether or not the tax type should appear in the admin list
1 function implements hook_commerce_tax_type_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

commerce_tax_ui_commerce_tax_type_info in modules/tax/commerce_tax_ui.module
Implements hook_commerce_tax_type_info().
1 invocation of hook_commerce_tax_type_info()
commerce_tax_types in modules/tax/commerce_tax.module
Returns an array of tax type objects keyed by name.

File

modules/tax/commerce_tax.api.php, line 36
Documents hooks provided by the Tax module.

Code

function hook_commerce_tax_type_info() {
  $tax_types = array();
  $tax_types['sales_tax'] = array(
    'title' => t('Sales tax'),
    'display_inclusive' => FALSE,
  );
  return $tax_types;
}