low_order_fee.php (1143B)
1 <?php 2 class ModelExtensionTotalLowOrderFee extends Model { 3 public function getTotal($total) { 4 if ($this->cart->getSubTotal() && ($this->cart->getSubTotal() < $this->config->get('total_low_order_fee_total'))) { 5 $this->load->language('extension/total/low_order_fee'); 6 7 $total['totals'][] = array( 8 'code' => 'low_order_fee', 9 'title' => $this->language->get('text_low_order_fee'), 10 'value' => $this->config->get('total_low_order_fee_fee'), 11 'sort_order' => $this->config->get('total_low_order_fee_sort_order') 12 ); 13 14 if ($this->config->get('total_low_order_fee_tax_class_id')) { 15 $tax_rates = $this->tax->getRates($this->config->get('total_low_order_fee_fee'), $this->config->get('total_low_order_fee_tax_class_id')); 16 17 foreach ($tax_rates as $tax_rate) { 18 if (!isset($total['taxes'][$tax_rate['tax_rate_id']])) { 19 $total['taxes'][$tax_rate['tax_rate_id']] = $tax_rate['amount']; 20 } else { 21 $total['taxes'][$tax_rate['tax_rate_id']] += $tax_rate['amount']; 22 } 23 } 24 } 25 26 $total['total'] += $this->config->get('total_low_order_fee_fee'); 27 } 28 } 29 }