简体   繁体   English

Magento:如何启用/禁用每个网站级别的模块输出?

[英]Magento: How to enable/disable module output per website level?

I would like to display an image in the onepage checkout payment methods section that would only show up in one of two website levels . 我想在onepage结帐付款方式部分中显示一个图片,该图片只显示在两个网站级别之一中 So I have three questions: 所以我有三个问题:

1) Am I correct to assume this change would be coded in app/design/frontend/default/mytheme/layout/checkout.xml ? 1)我是否正确假设此更改将在app / design / frontend / default / mytheme / layout / checkout.xml中编码?

2) if that is the correct file, what would the change be from: 2)如果这是正确的文件,更改将来自:

<!--
One page checkout payment methods block
-->
    <checkout_onepage_paymentmethod>
        <remove name="left"/>

        <block type="checkout/onepage_payment_methods" name="root" output="toHtml" template="checkout/onepage/payment/methods.phtml">
            <action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
        </block>
    </checkout_onepage_paymentmethod>

in order to point to, for example, checkout/onepage/payment/methods-site2.phtml when site2 is being used? 例如,当使用site2时,指向checkout / onepage / payment / methods-site2.phtml?

3) Is this the proper way to do this in 1.5.x ? 3)这是在1.5.x中执行此操作的正确方法吗?

  1. Yes
  2. You need add STORE_[your_store_code] handle and put there this store specific stuff. 您需要添加STORE_ [your_store_code]句柄并将此商店特定的东西放在那里。 More info you can read in this article . 您可以在本文中阅读更多信息。 So, in your case, you need update block with name root. 因此,在您的情况下,您需要名为root的更新块。 To change block template you need some method for this, let's say its name is setTemplate . 要更改块模板,您需要一些方法,比如它的名称是setTemplate So, in your layout update file you should write 因此,在您的布局更新文件中,您应该编写
<STORE_your_code>
    <reference name="root">
        <action method="setTemplate"><template>checkout/onepage/payment/methods-site2.phtml</template></action>
        <block type="my_cool/block" name="my_cool_block">
        ...
        </block>
    </reference>
</STORE_your_code>

3. Yes, adding store specific handle to your theme layout update file is the right way for magento CE 1.5.x. 3.是的,为主题布局更新文件添加特定于商店的句柄是magento CE 1.5.x的正确方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM