function commerce_tax_commerce_price_component_type_info in Commerce Core 7
Implements hook_commerce_price_component_type_info().
3 calls to commerce_tax_commerce_price_component_type_info()
- commerce_tax_components in modules/
tax/ commerce_tax.module - Returns an array of tax components from a price components array.
- commerce_tax_remove_taxes in modules/
tax/ commerce_tax.rules.inc - Rules actions: removes all taxes applied to a line item.
- commerce_tax_total_amount in modules/
tax/ commerce_tax.module - Returns the total amount of tax included in a price components array.
File
- modules/
tax/ commerce_tax.module, line 127 - Defines tax rates and Rules integration for configuring tax rules for applicability and display.
Code
function commerce_tax_commerce_price_component_type_info() {
$components = array();
// Add a price component type for each tax rate that specifies it.
foreach (commerce_tax_rates() as $name => $tax_rate) {
if ($tax_rate['price_component']) {
$components[$tax_rate['price_component']] = array(
'title' => $tax_rate['title'],
'display_title' => $tax_rate['display_title'],
'tax_rate' => $name,
);
}
}
return $components;
}