<?php
class ModelExtensionTotalTotal extends Model {
	public function getTotal($total) {
        $this->load->language('extension/total/total');

        if($this->config->get('promotion')['discount_percent']){
            $total_price = max(0, $total['total']);
            $total_price *=  0.90;
            $total['total'] *=  0.90;
        }else{ 
            $total_price = max(0, $total['total']);
        }

        $total['totals'][] = array(
            'code'       => 'total',
            'title'      => $this->language->get('text_total'),
            'value'      => $total_price,
            'sort_order' => $this->config->get('total_sort_order')
        );
	}
}