*/ class Mage_XmlConnect_Block_Checkout_Payment_Method_Purchaseorder extends Mage_Payment_Block_Form_Purchaseorder { /** * Prevent any rendering * * @return string */ protected function _toHtml() { return ''; } /** * Retrieve payment method model * * @return Mage_Payment_Model_Method_Abstract */ public function getMethod() { $method = $this->getData('method'); if (!$method) { $method = Mage::getModel('payment/method_purchaseorder'); $this->setData('method', $method); } return $method; } /** * Add payment method form to payment XML object * * @param Mage_XmlConnect_Model_Simplexml_Element $paymentItemXmlObj * @return Mage_XmlConnect_Model_Simplexml_Element */ public function addPaymentFormToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $paymentItemXmlObj) { $method = $this->getMethod(); if (!$method) { return $paymentItemXmlObj; } $formXmlObj = $paymentItemXmlObj->addChild('form'); $formXmlObj->addAttribute('name', 'payment_form_' . $method->getCode()); $formXmlObj->addAttribute('method', 'post'); $poNumber = $this->getInfoData('po_number'); $poNumberText = $this->__('Purchase Order Number'); $xml = << EOT; $fieldsetXmlObj = Mage::getModel('xmlconnect/simplexml_element', $xml); $formXmlObj->appendChild($fieldsetXmlObj); return $paymentItemXmlObj; } }