UPGRADE NOTE: Do not edit or add to this file if you wish to upgrade AbanteCart to newer versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ if (! defined ( 'DIR_CORE' )) { header ( 'Location: static_pages/' ); } class ModelTotalTax extends Model { public function getTotal(&$total_data, &$total, &$taxes) { if ($this->config->get('tax_status')) { foreach ($taxes as $tax_class_id => $subtax) { if (!empty($subtax)) { $tax_classes = $this->tax->getDescription($tax_class_id); foreach ($tax_classes as $tax_class) { $tax_amount = 0; //This is the same as $subtax['tax'], but we will recalculate $tax_amount = $this->tax->calcTaxAmount($subtax['total'], $tax_class); if ($tax_amount > 0) { $sort_order = $this->config->get('tax_sort_order'); if (is_numeric($tax_class['priority'])) { $sort_order = $sort_order . '.' . $tax_class['priority']; } $total_data[] = array( 'id' => 'tax', 'title' => $tax_class['description'] . ':', 'text' => $this->currency->format($tax_amount), 'value' => $tax_amount, 'sort_order' => $sort_order, 'total_type' => $this->config->get('tax_total_type') ); } $total += $tax_amount; } } } } } } ?>