You are here

function uc_line_item_tax in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_taxes/uc_taxes.module \uc_line_item_tax()

Handles the tax line item.

1 string reference to 'uc_line_item_tax'
uc_taxes_line_item in uc_taxes/uc_taxes.module
Implements hook_line_item().

File

uc_taxes/uc_taxes.module, line 220

Code

function uc_line_item_tax($op, $order) {
  switch ($op) {
    case 'load':
      $lines = array();
      $taxes = uc_taxes_calculate($order);
      foreach ($taxes as $tax) {
        $lines[] = array(
          'id' => $tax->summed ? 'tax' : 'tax_included',
          'title' => $tax->name,
          'amount' => $tax->amount,
          'weight' => variable_get('uc_li_tax_weight', 9) + $tax->weight / 10,
          'data' => $tax->data,
        );
      }
      return $lines;
  }
}