Magento:在信用卡表格中添加新字段 [英] Magento: Add New Field to Credit Card Form

查看:91
本文介绍了Magento:在信用卡表格中添加新字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试修改信用卡表单,以添加一些名为银行名称和银行电话号码的新自定义字段,看来这无法通过后端完成。

I'm trying to modify the credit card form to add some new custom fields named "Bank Name" and "Bank Phone Number" and it seems this cannot be done through the back-end.

我已经在网上搜索过,但是在如何向信用卡表格添加新的自定义字段方面,我找不到任何参考。我认为这几乎与在客户注册表格中添加新字段相同,但是我不知道如何明智地进行数据库操作。

I've searched the web and on here but I haven't been able to find anything in reference on how to add a new custom field to the credit card form. I would think it's almost the same as adding a new field to the customer registration form but I have no clue what to do database wise.

如果有人有什么可以使用的为此,我将不胜感激。

If anyone has anything I can use to work on this, I'd greatly appreciate it.

推荐答案

否,Magento管理控制台不会为您添加自定义列。

No, Magento admin panel will not add custom columns for you. You need to do it yourself.

首先,您需要编辑.phtml文件以包括这两个字段以显示在前端。

First, you need to edit the .phtml file to include these two fields to show up in frontend.

第二,您需要在相关的数据库表中添加两个新列(与字段名称相同,稍后说明)(我猜是sales_flat_order_payment)。但这会影响所有付款方式,因此将其定义为VARCHAR(255)NULL。

Second, you need to add two new columns (with same name as your fields, explained later) in relevant DB table (i guess sales_flat_order_payment). But that will affect for all payment methods, so define it something like VARCHAR(255) NULL.

第三,当Magento保存抄送信息时,您需要检查是否保存整个数据数组,则您发布的字段名称将与表字段匹配并自动插入。否则,您需要对其进行编辑。

Third, when Magento saves the CC info, you need to check if it is saving whole data array, then your field's name posted will match your table field and get inserted automatically. Else you need to edit it.

此外,下次请发布一些代码,至少尝试一下。

Also, next time please post some code, atleast something you have tried.

这篇关于Magento:在信用卡表格中添加新字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆