Page 1 of 1

Opencart taxes as discount.

Posted: Wed Jan 18, 2017 4:52 am
by yamahapower
I am using opencart version

I want to set different tax values to products for different countries. It's ok but when i want to give tax a negative value, it doesn't works.

Is this possible to use negative value on taxes by changing the code? I want to apply some discounts by tax. Please help.

Tax.php like this:

Code: Select all

class ModelTotalTax extends Model {
    public function getTotal(&$total_data, &$total, &$taxes) {
        foreach ($taxes as $key => $value) {
            if ($value > 0) {
                $total_data[] = array(
                    'code'       => 'tax',
                    'title'      => $this->tax->getRateName($key),
                    'value'      => $value,
                    'sort_order' => $this->config->get('tax_sort_order')

                $total += $value;

Re: Opencart taxes as discount.

Posted: Thu Jan 19, 2017 8:43 am
by yamahapower
I done myself.

Change ($value > 0) to ($value <> 0)