我最近安装了 Magento 的干净版本。我有一个自定义模块,它在旧模块上运行得很好,但在新模块上却不起作用(都是 1.9.2.1)。它显示在“系统”->“配置”->“高级”->“高级”下。
每当我尝试调用 mydomain/index.php/cron 时。它将重定向到 404 页面。
我尝试添加教程中的其余文件夹:Block、Helper、model 和 sql。但没有运气。
正如我所说,它正在使用相同版本号的旧安装上工作。我只是将整个模块和文件复制到 etc 文件夹中。
模块结构:
Files:
应用程序/代码/本地/Mxsxs2/Cron/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Mxsxs2_Cron>
<version>1.0.0</version>
</Mxsxs2_Cron>
</modules>
<frontend>
<routers>
<cron>
<use>standard</use>
<args>
<module>Mxsxs2_Cron</module>
<frontName>cron</frontName>
</args>
</cron>
</routers>
</frontend>
</config>
应用程序/代码/本地/Mxsxs2/Cron/controllers/IndexController.php
<?php
class Mxsxs2_Cron_IndexController extends Mage_Core_Controller_Front_Action
{
public $importfolder="var/import";
private $errormessages=array();
private $READ=null;
private $WRITE=null;
private $wasindb=0;
private $noofwarehouses=3; //for cost check
public function indexAction(){
echo("asd");
}
//----rest of the code and fucntions they are not important if i remove them it still does not work
}
应用程序/etc/modules/Mxsxs2_Cron.xml
<?xml version="1.0"?>
<config>
<modules>
<Mxsxs2_Cron>
<active>true</active>
<codePool>local</codePool>
</Mxsxs2_Cron>
</modules>
</config>
我安装了最新的 Magento 1.9.x.x 并且遇到了类似的问题。要调试它,这个问题对我有很大帮助:为什么我的 Magento 模块没有被加载?。基本上你需要检查 Mage_Core_Model_Config。我还想知道为什么我可以在“系统”->“配置”->“高级”->“高级”中看到我的模块,但它给出 404 错误。基本上这是 Magento 中的一个错误,模块的名称被破坏了。 Magento 强制名称的第一个字符大写。它不适用于第一个小写字符(但它显示在系统->配置->高级->高级中)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)