【问题标题】:Vote and Compare Blocks need to be taken out in magento投票和比较块需要在magento中取出
【发布时间】:2014-07-03 18:21:08
【问题描述】:

我在 /checkout/cart 页面中取出两个块时遇到了一些麻烦: - 比较产品块 - 投票块

我无法从右侧边栏中删除它们 在当前布局 xml

/layout/checkout.xml

只有 MY ONE 向右侧添加模板

<reference name="right">
 my adding template code here
</reference>

我刚刚从

中删除了所有添加到右侧边栏的模板

/layout/page.xml

结果我在右边栏看到这两个块(比较和投票)(

让我知道我可以从哪里删除它们?

谢谢

【问题讨论】:

    标签: magento sidebar


    【解决方案1】:

    我希望您使用 local.xml 进行自定义。

    在local.xml中

    <default>
    <!--other codes-->
    <remove name="catalog.compare.sidebar" />
    <remove name="right.poll" />
    <!--other codes-->
    </default>
    

    如果需要从结帐中删除 - 仅购物车页面并保留在其他页面上,则使用 &lt;checkout_cart_index&gt; 处理程序而不是使用 "unSetChild". 记住 &lt;remove&gt; 将完全删除块。

    【讨论】:

    • 使用 local.xml 几乎可以实现任何目标,这显示了 magento 的强大功能。这是最好的首选方式,因此请始终避免更改其他 XML 文件。因为,magento 在每个页面渲染中创建了一个临时的全局 XML,从而覆盖了本地 XML 中提到的函数。
    【解决方案2】:

    我发现问题出在哪里)

    Magento 布局包括其中之一

    /layout/poll.xml

    然后我看到了这些行

        <!-- Mage_Poll -->
        <reference name="right">
            <block type="poll/activePoll" name="right.poll">
                <action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action>
                <action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action>
            </block>
        </reference>
    
    </default>
    

    评论后他们消失了)

    【讨论】:

    • 帕斯卡,是的,这是可行的,但是上面的答案是完成此任务的正确方法。如果您要升级 Magento,这些更改将会丢失。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-15
    相关资源
    最近更新 更多