我正在使用 Magento 版本。1.6.2.0
我已阅读有关创建新付款方式的官方指南:http: //www.magentocommerce.com/wiki/5_-_modules_and_development/payment/create-payment-method-module
在目录中app/etc/modules
我创建了这个 xml 文件MyName_MyModule
:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<MyName_MyModule>
<active>true</active>
<codePool>local</codePool>
</MyName_MyModule>
</modules>
在app/code/local
我创建了这个文件夹MyName/MyModule
并且:MyName/MyModule/etc
MyName/MyModule/Model
里面MyName/MyModule/etc
有(config.xml):
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<MyName_MyModule>
<version>0.1.0</version>
</MyName_MyModule>
</modules>
<global>
<models>
<mymodule>
<class>MyName_MyModule_Model</class>
</mymodule>
</models>
<resources>
<mymodule_setup>
<setup>
<module>MyName_MyModule</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</mymodule_setup>
<mymodule_write>
<connection>
<use>core_write</use>
</connection>
</mymodule_write>
<mymodule_read>
<connection>
<use>core_read</use>
</connection>
</mymodule_read>
</resources>
</global>
和 system.xml:
<?xml version="1.0"?>
<config>
<sections>
<payment>
<groups>
<mymodule translate="label" module="payment">
<label>My Module</label>
<sort_order>670</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<active translate="label">
<label>Enabled</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</active>
<title translate="label">
<label>Title</label>
<frontend_type>text</frontend_type>
<sort_order>6</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</title>
</fields>
</mymodule>
</groups>
</payment>
</sections>
问题是:
我在面板管理中看到了付款方式,我也在系统/高级中看到了它
当我启用付款方式并尝试购买东西时,我在付款信息中看不到它!
我只看到 2 个单选按钮:
支票/汇票信用卡(已保存)
手动清除缓存,并从管理面板禁用。
添加默认值:
<!-- declare default configuration values for this module -->
<default>
<!-- 'payment' configuration section (tab) -->
<payment>
<!-- 'newmodule' configuration group (fieldset) -->
<mymodule>
<!-- by default this payment method is inactive -->
<active>1</active>
<!-- model to handle logic for this payment method -->
<model>mymodule/paymentMethod</model>
<!-- order status for new orders paid by this payment method -->
<order_status>pending</order_status>
<!-- default title for payment checkout page and order view page -->
<title>My Module</title>
<payment_action>authorize</payment_action>
<allowspecific>0</allowspecific>
</mymodule>
</payment>
</default>
还是不行!