Magento:如何将订单/付款信息添加到Admin-BackEnd [英] Magento: How to Add Order / Payment information to Admin-BackEnd
问题描述
我已经能够将一个名为 Bank Name 的自定义字段添加到保存在数据库中的信用卡付款选项中,但是我现在试图在此类的后端显示此类信息客户>管理客户>(选择客户)>订单>(选择订单),然后出现一个名为付款信息"的字段,该字段显示信用卡付款信息,这是我要银行名称的位置出现.
I´ve been able to add a custom field called Bank Name to the credit card payment option which saves into the DB, however I am now trying to display such information on the back-end under Customer > Manage Customer > (Select an customer) > Orders > (Select an Order) and there´s a field called Payment Information which displays the credit card payment info and this is where I want the Bank Name to appear.
我已经尝试编辑以下文件,但没有成功.
I have already tried to edit the following files with no success.
app \ design \ adminhtml \ default \ default \ template \ payment \ form \ cc.phtml和ccsave.phtml.
app\design\adminhtml\default\default\template\payment\form\cc.phtml and ccsave.phtml by adding the following.
<div class="input-box">
<label for="<?php echo $_code ?>_cc_bankname><?php echo Mage::helper('payment')->__('Bank Name') ?> <span class="required">*</span></label><br/>
<input type="text" id="<?php echo $_code ?>_cc_bankname" name="payment[cc_bankname]" title="<?php echo Mage::helper('payment')->__('Bank Name') ?>" class="input-text validate-cc-number" value="<?php echo $this->getInfoData('cc_bankname')?>"/>
</div>
但这只能在为客户手动创建新订单时启用用于编辑属性的选项.
but this only enables the option to edit the attribute when manually creating a new order for the customer.
有人知道应该编辑哪个文件以及如何编辑吗?我曾尝试在add/design/adminhtml下以及法师下进行cc.phtml和ccsave.phtml文件的编辑,但是没有运气.
Does anyone know which file should be edited and how? I´ve tried to edit the cc.phtml and ccsave.phtml files under add/design/adminhtml and also under mage but no luck.
忘记提及我正在使用Magento 1.7
Forgot to mention I´m working with Magento 1.7
:::::::::::::::: EDIT ::::::::::::::::
:::::::::::::::::::::::::::::::
在通过付款文件进行进一步搜索之后,我发现有两个文件需要编辑,但是我仍然需要一些帮助.
After further search thru the payment files, I found that there are two files that need to be edited but I still need some help.
我通过向文件添加两个功能来对\ app \ code \ local \ Mage \ Payment \ Block \ Info \ cc.phtml进行了修改.
I adited \app\code\local\Mage\Payment\Block\Info\cc.phtml by adding two functions to the file.
首先是公共功能
public function getCcBankname()
{
return $this->getInfo()->getCcBankname();
}
然后使用受保护的功能
if ($this->getInfo()->getCcBankname()) {
$data[Mage::helper('payment')->__('Bank Name')] = $this->getInfo()->getCcBankname();
}
然后我通过添加以下文件来编辑以下文件\ app \ code \ local \ Mage \ Payment \ Block \ Info \ ccsave.phtml.
Then I edited the following file \app\code\local\Mage\Payment\Block\Info\ccsave.phtml by adding this.
$transport = new Varien_Object(array(Mage::helper('payment')->__('Bank Name') => $info->getCcBankname(),));
现在,此修改允许银行名称出现在后端上我想要的确切位置,但是问题是它没有填充数据库中存储的数据.
Now this modifications allowed for the Bank Name to appear on the Backend exactly where I wanted it BUT the problem is that it not populating the data that´s store on the DB.
任何人都知道为什么它不从数据库中提取数据吗?
Anyone knows why it´s not pulling the data from the DB?
::::::::::::::::编辑#2 ::::::::::::::::
:::::::::::::::: EDIT #2 ::::::::::::::::
看来我所做的一切都可以,但是只有一个小问题.银行名称数据应在两个不同的表上设置. sales_flat_order_payment和sales_flat_quote_payment,但由于某些原因,数据仅保存在sales_flat_quote_payment中.我手动输入了sales_flat_order_payment上的数据,它可以正常工作,并且能够在后端可视化银行名称.
Well it seems that everything I did worked but there was just one little problem. The bank name data should be set on two different Tables. sales_flat_order_payment and sales_flat_quote_payment but for some reason the data is only saving on sales_flat_quote_payment. I manually entered the data on sales_flat_order_payment and it worked, I was able to visualize the Bank Name on the backend.
现在,我必须弄清楚如何在处理付款时如何将数据保存在sales_flat_order_payment上,以及为什么将其保存在sales_flat_quote_payment中,而不是保存在其他方面.
Now I have to figure out how to get the data to save on sales_flat_order_payment whenever a payment is processed and why it´s being saved on sales_flat_quote_payment but not on the other.
推荐答案
对于付款方式ccsave
,
Customer > Manage Customer > (Select customer) > Orders > (Select Order)
通常是由模板创建的
app/design/adminhtml/default/default/template/payment/info/default.phtml
这篇关于Magento:如何将订单/付款信息添加到Admin-BackEnd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!