Magento在布局中设置多商店愿望清单错误

时间:2013-01-17 18:30:24

标签: magento

我正在尝试在magento安装上设置新商店。它是安装的第二个网站/商店,托管在不同的域和不同的文件夹上。数据库是一样的。

我按照所有说明配置和设置新商店。我从旧商店复制了布局,设计和皮肤文件而不更改它们。理论上,两个商店都运行相同的代码。当我在浏览器中访问新商店时,出现以下错误:

警告:call_user_func_array()期望参数1是有效的回调,类'Mage_Wishlist_Helper_Data'在第323行的/httpdocs/app/code/core/Mage/Core/Model/Layout.php中没有方法''

0 [内部函数]:mageCoreErrorHandler(2,'call_user_func _...','/ var / www / vhosts ...',323,Array) 1 /httpdocs/app/code/core/Mage/Core/Model/Layout.php(323):call_user_func_array(Array,Array) 2 /httpdocs/app/code/core/Mage/Core/Model/Layout.php(213):Mage_Core_Model_Layout-> _generateAction(Object(Mage_Core_Model_Layout_Element),Object(Mage_Core_Model_Layout_Element)) 3 /httpdocs/app/code/core/Mage/Core/Model/Layout.php(209):Mage_Core_Model_Layout-> generateBlocks(Object(Mage_Core_Model_Layout_Element)) 4 /httpdocs/app/code/core/Mage/Core/Model/Layout.php(209):Mage_Core_Model_Layout-> generateBlocks(Object(Mage_Core_Model_Layout_Element)) 5 /httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(343):Mage_Core_Model_Layout-> generateBlocks() 6 /httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(270):Mage_Core_Controller_Varien_Action-> generateLayoutBlocks() 7 /httpdocs/app/code/core/Mage/Cms/controllers/IndexController.php(60):Mage_Core_Controller_Varien_Action-> loadLayout() 8 /httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418):Mage_Cms_IndexController-> defaultIndexAction() 9 /httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253):Mage_Core_Controller_Varien_Action-> dispatch('defaultIndex') 10 /httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176):Mage_Core_Controller_Varien_Router_Standard-> match(Object(Mage_Core_Controller_Request_Http)) 11 /httpdocs/app/code/core/Mage/Core/Model/App.php(340):Mage_Core_Controller_Varien_Front-> dispatch() 12 /httpdocs/app/Mage.php(627):Mage_Core_Model_App-> run(Array) 13 /httpdocs/index.php(81):Mage :: run('mysite','website')

我在Admin>下禁用了愿望清单配置>客户和管理中的模块输出>配置>高级>高级。

此外,我的local.xml具有以下内容:

        <!-- Removes 'Wishlist' link - Default position: 20 -->
        <!-- for Magento 1.3.x -->
        <action method="removeLinkByUrl"><url helper="wishlist/"/></action>

        <!-- for Magento 1.4.x -->
        <remove name="wishlist_link"/>

有任何想法或建议吗?

3 个答案:

答案 0 :(得分:0)

删除Magento中的心愿单链接很麻烦,可能会导致错误。您可以做的是按照这个答案将空白模板设置到心愿单链接,这样就不会导致错误(请参阅代码答案的底部):

https://stackoverflow.com/a/4424679/823549

答案 1 :(得分:0)

似乎是配置行

<action method="removeLinkByUrl"><url helper="wishlist/"/></action>

不正确。

这里发生的是Mage_Page_Block_Template_Links类型的块调用其函数removeLinkByUrl($ url)。参数$ url由另一个函数生成,该函数由hepler类Mage_Wishlist_Helper_Data提供。缺少函数的名称:而不是“wishlist /”应该是“wishlist / someFunctionThatGetsAUrl”。由于没有提供函数名称,系统无法找到它并抛出此错误

如果目标是隐藏wishlink块,则表示为行

<remove name="wishlist_link"/>

然后为什么不注释掉动作配置行,这对我来说似乎是多余的?

冗余可能来自尝试提供两个较旧的Magento版本,1.3x和1.4x。在1.3x中,动作配置可能是有效的,但在您当前的Magento版本中似乎不是这样。

答案 2 :(得分:0)

我试图以多种方式删除链接...最后我将所有顶部链接全部删除并硬编码我想要的链接。

将其添加到local.xml并删除top.links部分以将其从网站中删除:

 <reference name="root"> 
        <remove name="top.links" />
    </reference>
相关问题