首页 > 解决方案 > 在 magento 的自定义模块中找不到页面

问题描述

我收到以下错误:

404 Error
Page not found.

一切看起来都不错,我已经从后端清除了缓存、注销和登录,还重置了权限,但仍然出现此错误。

我的代码:等/模块:Cloud_Freeshipping.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Cloud_Freeshipping>
            <active>true</active>
            <codePool>community</codePool>
        </Cloud_Freeshipping>
    </modules>
</config>

app/code/community/Cloud/Freeshipping/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Cloud_Freeshipping>
            <version>1.0.0</version>
        </Cloud_Freeshipping>
    </modules>
    <global>
        <helpers>
            <cloud_freeshipping>
                <class>Cloud_Freeshipping_Helper</class>
            </cloud_freeshipping>
        </helpers>
    </global>
</config>

app/code/community/Cloud/Freeshipping/etc/adminhtml.xml

<?xml version="1.0"?>
<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <cloud_freeshipping translate="title">
                                        <title>FreeShipping Notification</title>
                                    </cloud_freeshipping>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

app/code/community/Cloud/Freeshipping/etc/system.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <cloud_freeshipping translate="label">
            <label>Free Shipping Notification</label>
            <sort_order>1</sort_order>
        </cloud_freeshipping>
    </tabs>

    <sections>
        <cloud_freeshipping translate="label">
            <tab>cloud_freeshipping</tab>
            <label>Configuration</label>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <basic_config translate="label">
                    <label>Basic Config</label>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <total_cart translate="label">
                            <label>Valor de Envio</label>
                            <frontend_type>text</frontend_type>                
                            <sort_order>2</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <comment>Selecione o total do valor para free shipping</comment>
                        </total_cart>
                    </fields>

                </basic_config>
            </groups>
        </cloud_freeshipping>
    </sections>
</config>

app/code/community/Cloud/Freeshipping/Helper/Data.php

class Cloud_Freeshipping_Helper_Data extends Mage_Core_Helper_Abstract
{

}

标签: magentomagento-1.9

解决方案


在文件 app/code/community/Cloud/Freeshipping/etc/adminhtml.xml 中,尝试添加<all>标签,<admin>如下所示:

<?xml version="1.0"?>
<config>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <cloud_freeshipping translate="title">
                                        <title>FreeShipping Notification</title>
                                    </cloud_freeshipping>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

然后注销并再次登录到管理员。


推荐阅读