/** * Get sales item (quote item, order item etc) price including tax based on row total and tax amount * * @param Varien_Object $item * @return float */ public function getPriceInclTax($item) { if ($item->getPriceInclTax()) { return $item->getPriceInclTax(); } $qty = $item->getQty() ? $item->getQty() : ($item->getQtyOrdered() ? $item->getQtyOrdered() : 1); $taxAmount = $item->getTaxAmount() + $item->getDiscountTaxCompensation(); $price = floatval($qty) ? ($item->getRowTotal() + $taxAmount) / $qty : 0; return Mage::app()->getStore()->roundPrice($price); }
/** * Get sales item (quote item, order item etc) price including tax based on row total and tax amount * excluding weee tax * * @param Varien_Object $item * @return float */ public function getPriceInclTax($item) { if ($item->getPriceInclTax()) { return $item->getPriceInclTax(); } $qty = $item->getQty() ? $item->getQty() : ($item->getQtyOrdered() ? $item->getQtyOrdered() : 1); //Unit price is rowtotal/qty return $qty > 0 ? $this->getSubtotalInclTax($item) / $qty : 0; }