Magento 1.7.2-在管理、销售、订单中添加自定义字段
我将遵循以下教程:。在第2步的末尾,我应该在Admin=>Sales=>Order上看到我的字段,但我什么也看不到 在sales\u flat\u quote\u payment中,我可以看到Magento 1.7.2-在管理、销售、订单中添加自定义字段,magento,magento-1.7,ecommerce-sales,Magento,Magento 1.7,Ecommerce Sales,我将遵循以下教程:。在第2步的末尾,我应该在Admin=>Sales=>Order上看到我的字段,但我什么也看不到 在sales\u flat\u quote\u payment中,我可以看到telefono\u no字段,在sales\u flat\u order\u payment中也可以看到字段。当我买东西时,Magento会将电话数据telefono_no保存在数据库中。无论如何,我的mysql4-install-0.1.0.php是: $install = $this; $instal
telefono\u no
字段,在sales\u flat\u order\u payment中也可以看到字段。当我买东西时,Magento会将电话数据telefono_no
保存在数据库中。无论如何,我的mysql4-install-0.1.0.php是:
$install = $this;
$install->startSetup();
$install->run("
ALTER TABLE `".$install->getTable('sales/quote_payment')."` ADD `telefono_no` VARCHAR(7) NOT NULL DEFAULT '0000000';
ALTER TABLE `".$install->getTable('sales/order_payment')."` ADD `telefono_no` VARCHAR(7) NOT NULL DEFAULT '0000000';
");
$install->endSetup();
在我的config.xml中,我有:
<?xml version="1.0"?>
<config>
<modules>
<Xs_Pago>
<version>0.1.0</version>
</Xs_Pago>
</modules>
<global>
<fieldsets>
<sales_convert_quote_payment>
<telefono_no>
<to_order_payment>*</to_order_payment>
</telefono_no>
</sales_convert_quote_payment>
</fieldsets>
</global>
</config>
0.1.0
*
关于的代码只应将字段添加到db中,并在下订单时将值从quote_payment复制到order_payment
代码不会显示任何信息,在您参考的示例中显示该信息的原因是由于Mage\u Payment\u Block\u info
<?php
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')->__('Check No#') => $info->getCheckNo(),
Mage::helper('payment')->__('Check Date') => $info->getCheckDate()
));
return $transport;
}
}
如果我理解了您的答案,您会告诉我,我正在遵循的示例是不完整的,在表“sales-order”中添加列的唯一方法是创建新模板吗?你发布的代码是什么?我要把它放在哪里?在我的目录“Block”中?我关注了你的链接,但没有澄清任何事情。