как добавить пользовательские поля в модуль оплаты magento - PullRequest
1 голос
/ 27 февраля 2012

Я скачал модуль из блога, и он отлично работает.но мне нужно добавить еще два текстовых поля.

 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.

1 Ответ

0 голосов
/ 27 февраля 2012

Пожалуйста, обратитесь к тем же вопросам, на которые вы ответили здесь раньше

Блок информации об оплате Magento

Сохранение дополнительных данных при заказе в Magento

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...