/** * Calculates tax amounts for the row item using $this->_calculator * * @param Mage_Sales_Model_Quote_Item $item * @return $this */ protected function _calcTaxAmounts(&$item) { //@nelkaake -a 16/11/10: Calculator only works in magento 1.4 and up. if (!Mage::helper('rewards/version')->isMageVersionAtLeast('1.4.2')) { return $this; } // @nelkaake -a 16/11/10: Tax calculation methods $tax = $this->_calculator->calcTaxAmount($item->getRowTotal(), $item->getTaxPercent(), false); $baseTax = $this->_calculator->calcTaxAmount($item->getBaseRowTotal(), $item->getTaxPercent(), false); $item->setTaxAmount($tax); $item->setBaseTaxAmount($baseTax); $item->setTaxableAmount($item->getRowTotal()); $item->setBaseTaxableAmount($item->getBaseRowTotal()); //@nelkaake -a 26/01/11: We don't set this so that we can later use the row total including tax to find out // how much of the order was discounted due to catalog redemption rules. $item->setRowTotalInclTax($item->getRowTotal() + $tax); $item->setBaseRowTotalInclTax($item->getBaseRowTotal() + $baseTax); return $this; }