I have added some custom header/footer phtml files to my Magento installation, the footer uses an static block called 'Footer Links' - this is a HTML block added via the Magento 'CMS' section.

It is possible to have some logic which 'hides' or disables this block on any checkout page?

有帮助吗?

解决方案

One way to do it would be via the local.xml in /app/design/frontend/yourpackagename/yourthemename/layout/local.xml. The handles that you need to add depend on how your checkout process is configured. Here is some example code to get you started:

<checkout_cart_index>
    <remove name="footer">
</checkout_cart_index>
<checkout_onepage_index>
    <remove name="footer">
</checkout_onepage_index>

This is removing the entire footer block, but you can use it to remove any block name that you have. Alan Storms layoutviewer module is great for figuring out what the layout handles are: http://alanstorm.com/layouts_blocks_and_templates.

其他提示

Hi i have a custom code to disable the footer links block in checkout page add this code in footer.phtml file

<?php $page_route=Mage::app()->getRequest()->getRouteName(); ?>
    <?php if($page_route !='checkout'){ ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_links')->toHtml() ?>
    <?php } ?>

And comment or remove this code in cms.xml file

<block type="cms/block" name="cms_footer_links" before="footer_links">                
     <action method="setBlockId"><block_id>footer_links</block_id></action>
</block>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top