cancel
Showing results for 
Search instead for 
Did you mean: 

Subtract Tax instead of adding in Grand Total

Subtract Tax instead of adding in Grand Total

Hello, following the instructions to update the M2ePro module, I uninstalled in Magento Connect and then I installed.

After this, I see that in the cart, the grand total Subtract the VAT instead of adding like in the capture.

I have tested a lot of things but I don´t know where is the problem as I don´t touched nothing.

ThanksCaptura de pantalla 2017-11-14 a las 17.22.57.png

3 REPLIES 3

Re: Subtract Tax instead of adding in Grand Total

Nobody knows? We can´t find the solution of this.

Re: Subtract Tax instead of adding in Grand Total

Did you solve this issue?

Experience the same, struggling to find out why.

Re: Subtract Tax instead of adding in Grand Total

The same issue.

 

I've added M2E pro extension (6.4.14) to Magento 1.9.3.2.

 

On the last step of checkout grand total does not contain tax amount so a user does not pay the tax. Then I cannot make invoice because grand total there contains tax and the user has not payed the tax.

 

Any advice?

 

Update:

I've wrote to M2E pro support and they gave me the solution:

 

"This issue you have is most probably related to Magento bug due to which the logic of actions of TAX calculation is performed in the wrong order. 
 
To resolve the problem, you  just need to navigate to file:
 
app/code/core/Mage/Sales/Model/Config/Ordered.php
_getSortedCollectorCodes()
 
and replace the code in the file with code below:"
 
protected function _getSortedCollectorCodes()
{
    if (Mage::app()->useCache('config')) {
        $cachedData = Mage::app()->loadCache($this->_collectorsCacheKey);
        if ($cachedData) {
            return unserialize($cachedData);
        }
    }
    $configArray = $this->_modelsConfig;
    // invoke simple sorting if the first element contains the "sort_order" key
    reset($configArray);
    $element = current($configArray);
    if (isset($element['sort_order']) && false) {
        uasort($configArray, array($this, '_compareSortOrder'));
        $sortedCollectors = array_keys($configArray);
    } else {

        $sortedCollectors = array_keys($configArray);

        foreach ($configArray as $code => &$data) {
            foreach ($data['before'] as $positionCode) {
                if (!isset($configArray[$positionCode])) {
                    continue;
                }
                if (!in_array($code, $configArray[$positionCode]['after'], true)) {
                    // Also add additional after condition for related total,
                    // to keep it always after total with before value specified
                    $configArray[$positionCode]['after'][] = $code;
                }
                $currentPosition = array_search($code, $sortedCollectors, true);
                $desiredPosition = array_search($positionCode, $sortedCollectors, true);
                if ($currentPosition > $desiredPosition) {
                    // Only if current position is not corresponding to before condition
                    array_splice($sortedCollectors, $currentPosition, 1); // Removes existent
                    array_splice($sortedCollectors, $desiredPosition, 0, $code); // Add at new position
                }
            }
        }

        // Sort out totals with after position specified
        foreach ($configArray as $code => &$data) {
            $maxAfter = null;
            $currentPosition = array_search($code, $sortedCollectors, true);
            foreach ($data['after'] as $positionCode) {
                $maxAfter = max($maxAfter, array_search($positionCode, $sortedCollectors, true));
            }
            if ($maxAfter !== null && $maxAfter > $currentPosition) {
                // Moves only if it is in front of after total
                array_splice($sortedCollectors, $maxAfter + 1, 0, $code); // Add at new position
                array_splice($sortedCollectors, $currentPosition, 1); // Removes existent
            }
        }
    }

    if (Mage::app()->useCache('config')) {
        Mage::app()->saveCache(serialize($sortedCollectors), $this->_collectorsCacheKey, array(
                Mage_Core_Model_Config::CACHE_TAG
            )
        );
    }
    return $sortedCollectors;
}