diff --git a/uc_taxes/uc_taxes.module b/uc_taxes/uc_taxes.module index d439f5a..d84142b 100644 --- a/uc_taxes/uc_taxes.module +++ b/uc_taxes/uc_taxes.module @@ -272,22 +272,17 @@ function uc_line_item_tax_subtotal($op, $order) { $has_taxes = FALSE; $different = FALSE; - if (is_array($order->products)) { - foreach ($order->products as $item) { - $amount += $item->price * $item->qty; - } - } if (is_array($order->line_items)) { foreach ($order->line_items as $key => $line_item) { if ($line_item['type'] == 'subtotal') { continue; } - if (substr($line_item['type'], 0, 3) != 'tax') { + if (substr($line_item['type'], 0, 3) == 'tax') { $amount += $line_item['amount']; - $different = TRUE; + $has_taxes = TRUE; } else { - $has_taxes = TRUE; + $different = TRUE; } } } @@ -300,7 +295,7 @@ function uc_line_item_tax_subtotal($op, $order) { return array(array( 'id' => 'tax_subtotal', 'title' => t('Subtotal excluding taxes'), - 'amount' => $amount, + 'amount' => uc_order_get_total($order) - $amount, 'weight' => variable_get('uc_li_tax_subtotal_weight', 7), )); }