handling.php (1096B)
1 <?php 2 class ModelExtensionTotalHandling extends Model { 3 public function getTotal($total) { 4 if (($this->cart->getSubTotal() > $this->config->get('total_handling_total')) && ($this->cart->getSubTotal() > 0)) { 5 $this->load->language('extension/total/handling'); 6 7 $total['totals'][] = array( 8 'code' => 'handling', 9 'title' => $this->language->get('text_handling'), 10 'value' => $this->config->get('total_handling_fee'), 11 'sort_order' => $this->config->get('total_handling_sort_order') 12 ); 13 14 if ($this->config->get('total_handling_tax_class_id')) { 15 $tax_rates = $this->tax->getRates($this->config->get('total_handling_fee'), $this->config->get('total_handling_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_handling_fee'); 27 } 28 } 29 }