简体   繁体   中英

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 . 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 ?

2) if that is the correct file, what would the change be from:

<!--
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?

3) Is this the proper way to do this in 1.5.x ?

  1. Yes
  2. You need add STORE_[your_store_code] handle and put there this store specific stuff. More info you can read in this article . So, in your case, you need update block with name root. To change block template you need some method for this, let's say its name is 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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