You are here

function uc_taxes_action_apply_tax_subtotal in Ubercart 5

Workflow-ng action callback to calculate a tax.

Parameters

$order: The order object being considered.

$tax: The tax rule calculating the amount.

Return value

The line item array representing the amount of tax.

File

uc_taxes/uc_taxes_workflow.inc, line 139
This file contains the Workflow-ng hooks and functions necessary to make the tax related entity, conditions, events, and actions work.

Code

function uc_taxes_action_apply_tax_subtotal($order, $tax) {
  $line_item = (object) array(
    'id' => 'subtotal_' . $tax->id,
    'name' => t('Subtotal excluding taxes'),
    'amount' => 2,
    'weight' => 8,
  );
  return array(
    'tax_line_item' => $line_item,
  );
}