You are here

function _uc_taxes_to_line_item in Ubercart 7.3

Converts a tax object to the format expected by line item callbacks.

Parameters

$tax: A tax object as returned by hook_uc_taxes_calculate().

Return value

array A line item array suitable for returning from line item callbacks.

2 calls to _uc_taxes_to_line_item()
uc_line_item_tax_display in uc_taxes/uc_taxes.module
Tax line item callback.
uc_taxes_uc_order in uc_taxes/uc_taxes.module
Implements hook_uc_order().

File

uc_taxes/uc_taxes.module, line 281
Ubercart Taxes module.

Code

function _uc_taxes_to_line_item($tax) {
  $line = array(
    'id' => $tax->summed ? 'tax' : 'tax_included',
    'title' => !empty($tax->name) ? $tax->name : $tax->id,
    'amount' => $tax->amount,
    'weight' => variable_get('uc_li_tax_weight', 9) + (!empty($tax->weight) ? $tax->weight / 10 : 0),
    'data' => isset($tax->data) ? $tax->data : array(),
  );
  $line['data']['tax_id'] = $tax->id;
  return $line;
}