xml - 将自定义字段添加到贝宝模块 magento 1.9
问题描述
我需要在 paypal 配置中添加一个额外的字段,但由于教皇配置中使用了“无限”组,我无法添加它。是否可以向核心 paypal v.1.6.0.6 magento 1.9 模块添加自定义字段?
我正在我的自定义模块的 system.xml 文件中尝试使用以下代码,但没有运气。同一 xml 中的 cashondelivery 选项可以正常工作。
任何帮助将不胜感激
<?xml version="1.0"?>
<config>
<sections>
<payment>
<groups>
<paypal_payments>
<payments_pro_hosted_solution translate="label comment">
<fields>
<pphs_required_settings translate="label">
<fields>
<pphs_required_settings_pphs translate="label">
<fields>
<charge_type translate="label">
<label>Payment Charge Type</label>
<frontend_type>select</frontend_type>
<source_model>paymentcharge/system_config_source_chargetype</source_model>
<sort_order>22</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_type>
<charge_value translate="label">
<label>Payment Charge</label>
<frontend_type>text</frontend_type>
<sort_order>24</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_value>
</fields>
</pphs_required_settings_pphs>
</fields>
</pphs_required_settings>
</fields>
</payments_pro_hosted_solution>
</paypal_payments>
<cashondelivery translate="label">
<fields>
<charge_type translate="label">
<label>Payment Charge Type</label>
<frontend_type>select</frontend_type>
<source_model>paymentcharge/system_config_source_chargetype</source_model>
<sort_order>200</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_type>
<charge_value translate="label">
<label>Payment Charge</label>
<frontend_type>text</frontend_type>
<sort_order>201</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_value>
</fields>
</cashondelivery>
</groups>
</payment>
</sections>
</config>
这里是magento 1.9 system.xml文件的官方paypal模块v 1.6.0.6
https://github.com/mgtf/magento-1.9.2.0/blob/master/app/code/core/Mage/Paypal/etc/system.xml
解决方案
试试这个
<?xml version="1.0"?>
<config>
<sections>
<payment>
<groups>
<paypal_payments>
<payments_pro_hosted_solution translate="label comment">
<fields>
<pphs_required_settings translate="label">
<fields>
<pphs_required_settings_pphs translate="label">
<label>Payments Pro Hosted Solution</label>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<frontend_model>paypal/adminhtml_system_config_fieldset_expanded</frontend_model>
<sort_order>10</sort_order>
<fields>
<charge_type translate="label">
<label>Payment Charge Type</label>
<frontend_type>select</frontend_type>
<source_model>paymentcharge/system_config_source_chargetype</source_model>
<sort_order>22</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_type>
<charge_value translate="label">
<label>Payment Charge</label>
<frontend_type>text</frontend_type>
<sort_order>24</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_value>
</fields>
</pphs_required_settings_pphs>
</fields>
</pphs_required_settings>
</fields>
</payments_pro_hosted_solution>
</paypal_payments>
<cashondelivery translate="label">
<fields>
<charge_type translate="label">
<label>Payment Charge Type</label>
<frontend_type>select</frontend_type>
<source_model>paymentcharge/system_config_source_chargetype</source_model>
<sort_order>200</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_type>
<charge_value translate="label">
<label>Payment Charge</label>
<frontend_type>text</frontend_type>
<sort_order>201</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</charge_value>
</fields>
</cashondelivery>
</groups>
</payment>
</sections>
</config>
推荐阅读
- javascript - 单击一个按钮并打开下一个网址
- reactjs - 反应 for 循环创建无限调用
- python - PD_DF_NOT_CONTAIN
- model-view-controller - 使用 MVC 控制器作为 ClickListener 处理按钮上的 clickEvent 以查看
- laravel - Laravel - 如何使用外部 API 的参数搜索并重定向到下一页
- javascript - 无法将文本框值写入 .text 文件
- django - 带有 Q 的 Django 查询集给出了错误的长度
- r - 从ggplot图例中删除关键字母
- debugging - 调试 .net 核心 WebApp 非常慢
- excel - 设置一个用户表单文本框以根据用户表单命令按钮将数据输入活动工作表和范围?