gpt4 book ai didi

xml - 将自定义字段添加到 paypal 模块 magento 1.9

转载 作者:太空宇宙 更新时间:2023-11-03 16:20:59 25 4
gpt4 key购买 nike

我需要在 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>

关于xml - 将自定义字段添加到 paypal 模块 magento 1.9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58234178/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com