2012-02-27 5 views
1

블로그에서 모듈을 다운로드했으며 정상적으로 작동합니다. 하지만 두 개의 텍스트 상자를 추가해야합니다.magento 결제 모듈에 맞춤 입력란을 추가하는 방법

class Excellence_Pay_Block_Info_Pay extends Mage_Payment_Block_Info 
    { 
     protected function _prepareSpecificInformation($transport = null) 
     { 
      if (null !== $this->_paymentSpecificInformation) { 
       return $this->_paymentSpecificInformation; 
      } 
      $info = $this->getInfo(); 
      $transport = new Varien_Object(); 
      $transport = parent::_prepareSpecificInformation($transport); 
      $transport->addData(array(
       Mage::helper('payment')->__('Voucher #') => $info->getCheckNo(), 
       Mage::helper('payment')->__('Voucher Date') => $info->getCheckDate(), 
       Mage::helper('payment')->__('Field Date') => $info->getCheckField(), //custom field 
       Mage::helper('payment')->__('Field new') => $info->getCheckField1() //custom field 
      )); 
      return $transport; 
     } 
    } 

I change the code to this in block/info, and change some code in model/pay.php 




public function assignData($data) 
     { 
      if (!($data instanceof Varien_Object)) { 
       $data = new Varien_Object($data); 
      } 
      $info = $this->getInfoInstance(); 
      $info->setCheckNo($data->getCheckNo()) 
      ->setCheckDate($data->getCheckDate()) 
      ->setCheckField($data->getCheckField()) 
      ->setCheckField1($data->getCheckField1()); 
      return $this; 
     } 

을 추가하는 코드 등/config.xml에

<fieldsets> 
      <sales_convert_quote_payment> 
       <check_no> 
        <to_order_payment>*</to_order_payment> 
       </a> 
       <check_date> 
        <to_order_payment>*</to_order_payment> 
       </check_date> 
       <check_field> 
        <to_order_payment>*</to_order_payment> 
       </check_field> 
       <check_field1> 
        <to_order_payment>*</to_order_payment> 
       </check_field1> 
      </sales_convert_quote_payment> 
     </fieldsets> 

하지만이 작동하지 않습니다. . 또한 데이터베이스를 업데이트하고 pay.phtml에 입력 텍스트 상자를 추가했습니다.

답변

관련 문제