/catalog/model/total/handling.php
Since this still uses the old-style Order Total, I use:
Order Total: 99999
Fee: 3.5%
Tax Class: None
Status: Enabled
Sort Order: 2
And I'm good to go. Hope I'm putting this is the right place...
Code: Select all
<?php
class ModelTotalHandling extends Model {
public function getTotal(&$total_data, &$total, &$taxes) {
if ($this->config->get('handling_status') && ($this->cart->getSubTotal() < $this->config->get('handling_total'))) {
$this->load->language('total/handling');
$this->load->model('localisation/currency');
$rate = $this->config->get('handling_fee');
if (strpos($rate, '%') !== false) {
$rate = str_replace('%', '', $rate);
$totalcost = $this->cart->getSubTotal() * ((float)$rate / 100);
} else {
$totalcost = (float)$rate;
}
$total_data[] = array(
'title' => $this->language->get('text_handling'),
'text' => $this->currency->format($totalcost),
'value' => $totalcost,
'sort_order' => $this->config->get('handling_sort_order')
);
if ($this->config->get('handling_tax_class_id')) {
if (!isset($taxes[$this->config->get('handling_tax_class_id')])) {
$taxes[$this->config->get('handling_tax_class_id')] = $totalcost / 100 * $this->tax->getRate($this->config->get('handling_tax_class_id'));
} else {
$taxes[$this->config->get('handling_tax_class_id')] += $totalcost / 100 * $this->tax->getRate($this->config->get('handling_tax_class_id'));
}
}
$total += $totalcost;
}
}
}
?>