Post by yamahapower » Wed Jan 18, 2017 4:52 am

I am using opencart version 2.1.0.1.

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

<?php
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;
            }
        }
    }
}

Newbie

Posts

Joined
Wed Jan 18, 2017 4:41 am

Post by yamahapower » Thu Jan 19, 2017 8:43 am

I done myself.

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

Newbie

Posts

Joined
Wed Jan 18, 2017 4:41 am
Who is online

Users browsing this forum: No registered users and 42 guests