<?php
class ModelTotalCodFee extends Model {
	public function getTotal(&$total_data, &$total, &$taxes) {

		if ( $this->config->get('cod_fee_status') ){

			if( $this->cart->getSubTotal() <= $this->config->get('cod_fee_total')  && $this->session->data['payment_method']['id'] == 'cod' ){

				$this->load->language('total/cod_fee');

				$this->load->model('localisation/currency');

				$total_data[] = array(
					'title'      => $this->language->get('text_cod_fee'),
					'text'       => $this->currency->format($this->config->get('cod_fee_fee')),
					'value'      => $this->config->get('cod_fee_fee'),
					'sort_order' => $this->config->get('cod_fee_sort_order')
				);

				$total += $this->config->get('cod_fee_fee');

			}//if-end

		}//if-end

	}//function-end

}//class-end
?>