【问题标题】:Magento: New Payment Method Not Show in CheckoutMagento:结帐时未显示新的付款方式
【发布时间】:2013-09-25 17:57:47
【问题描述】:

我正在使用 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/etcMyName/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>

还是不行!

【问题讨论】:

  • 添加了默认...不起作用!
  • 那么,有什么对你有用的吗?如果有,可以分享一下吗?

标签: magento methods payment checkout


【解决方案1】:

希望这会有所帮助。我认为您的 config.xml 文件遗漏了一些配置。参考这个链接http://inchoo.net/ecommerce/magento/how-to-create-magento-payment-module/

【讨论】:

    【解决方案2】:

    您忘记添加配置 xml

     <default>
    <!-- 'payment' configuration section (tab) -->
            <payment>
    <!-- 'newmodule' configuration group (fieldset) -->
                <newmodule>
    <!-- by default this payment method is inactive -->
                    <active>0</active>
    <!-- model to handle logic for this payment method -->
                    <model>newmodule/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>Credit Card (Authorize.net)</title>
    
                    <cctypes>AE,VI,MC,DI</cctypes>
                    <payment_action>authorize</payment_action>
                    <allowspecific>0</allowspecific>
                </newmodule>
             </payment>
        </default>
    

    没有这个,您将无法在付款页面上看到付款选项。

    希望这一定能解决您的问题。

    【讨论】:

    • @Gi Gu,我相信我的回答肯定会帮助你,如果你能接受我的回答,我会很高兴
    猜你喜欢
    • 1970-01-01
    • 2018-05-31
    • 2013-05-02
    • 1970-01-01
    • 2015-09-13
    • 1970-01-01
    • 2018-10-29
    • 1970-01-01
    • 2012-05-13
    相关资源
    最近更新 更多