/** * Create and return new order item based on profile item data and $itemInfo * for initial payment * * @param Varien_Object $itemInfo * @return Mage_Sales_Model_Order_Item */ protected function _getInitialItem($itemInfo) { $price = $itemInfo->getPrice() ? $itemInfo->getPrice() : $this->getInitAmount(); $shippingAmount = $itemInfo->getShippingAmount() ? $itemInfo->getShippingAmount() : 0; $taxAmount = $itemInfo->getTaxAmount() ? $itemInfo->getTaxAmount() : 0; $item = Mage::getModel('sales/order_item')->setStoreId($this->getStoreId())->setProductType(Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)->setIsVirtual(1)->setSku('initial_fee')->setName(Mage::helper('sales')->__('Recurring Profile Initial Fee'))->setDescription('')->setWeight(0)->setQtyOrdered(1)->setPrice($price)->setOriginalPrice($price)->setBasePrice($price)->setBaseOriginalPrice($price)->setRowTotal($price)->setBaseRowTotal($price)->setTaxAmount($taxAmount)->setShippingAmount($shippingAmount); $option = array('label' => Mage::helper('sales')->__('Payment type'), 'value' => Mage::helper('sales')->__('Initial period payment')); $this->_addAdditionalOptionToItem($item, $option); return $item; }
public function render(Varien_Object $row) { return $row->getSubtotal() + $row->getShippingAmount(); }