/** * Retrieve subtotal price include tax html formated content * * @param Varien_Object $item * @return string */ public function displaySubtotalInclTax($item) { $baseTax = $item->getTaxBeforeDiscount() ? $item->getTaxBeforeDiscount() : ($item->getTaxAmount() ? $item->getTaxAmount() : 0); $tax = $item->getBaseTaxBeforeDiscount() ? $item->getBaseTaxBeforeDiscount() : ($item->getBaseTaxAmount() ? $item->getBaseTaxAmount() : 0); return $this->displayPrices($item->getBaseRowTotal() + $baseTax, $item->getRowTotal() + $tax); }
/** * Get sales item (quote item, order item etc) row total price including tax * * @param Varien_Object $item * @return float */ public function getSubtotalInclTax($item) { if ($item->getRowTotalInclTax()) { return $item->getRowTotalInclTax(); } $tax = $item->getTaxAmount() + $item->getDiscountTaxCompensation(); return $item->getRowTotal() + $tax; }
public function renderExport(Varien_Object $_item) { return Mage::helper('mageworx_customerplus')->displayPrices($_item->getBaseRowTotal() - $_item->getBaseDiscountAmount() + $_item->getBaseTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount(), $_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getWeeeTaxAppliedRowAmount(), $_item->getOrderId()); }
/** * Validate Product Rule Condition * * @param Varien_Object $object * @return bool */ public function validate(Varien_Object $object) { $product = Mage::getModel('catalog/product')->load($object->getProductId())->setQuoteItemQty($object->getQty())->setQuoteItemPrice($object->getPrice())->setQuoteItemRowTotal($object->getRowTotal()); return parent::validate($product); }
/** * Add a usual line item with amount and qty * * @param Varien_Object $salesItem * @return Varien_Object */ protected function _addRegularItem(Varien_Object $salesItem) { if ($this->_salesEntity instanceof Mage_Sales_Model_Order) { $qty = (int) $salesItem->getQtyOrdered(); $amount = (double) $salesItem->getPrice(); // TODO: nominal item for order } else { $qty = (int) $salesItem->getTotalQty(); $amount = $salesItem->isNominal() ? 0 : (double) $salesItem->getCalculationPrice(); } // workaround in case if item subtotal precision is not compatible with PayPal (.2) $subAggregatedLabel = ''; if ($amount - round($amount, 2)) { $amount = $amount * $qty; $subAggregatedLabel = ' x' . $qty; $qty = 1; } // aggregate item price if item qty * price does not match row total if ($amount * $qty != $salesItem->getRowTotal()) { $amount = (double) $salesItem->getRowTotal(); $subAggregatedLabel = ' x' . $qty; $qty = 1; } return $this->addItem($salesItem->getName() . $subAggregatedLabel, $qty, $amount, $salesItem->getSku()); }