Add custom header for Checkout pages in Magento (1

2019-04-03 03:25发布

I am trying to add a customised header to my Checkout pages, I have figured out removing the header from the page is basically adding a node in the /layout/checkout.xml file, could anyone explain how to basically a new altered header that only applies to all the Checkout pages.

Current default/layout/checkout.xml

 <default>
   <remove name="footer"> <!-- removes the footer from checkout -->
... // all other xml data..
</default>

pseudocode for my theme

if (a CHECKOUT PAGE) {
  use 'custom checkout header'
else
  use the standard default header.

2条回答
放荡不羁爱自由
2楼-- · 2019-04-03 03:52

You will have to add something like

<?php echo $this->getChildHtml('new_header') ?>

in your page template files (1column.phtml, 2columns-left.phtml, etc)

Also try changing

<reference name="root">

to

<reference name="head">

if it is still not working.

查看更多
等我变得足够好
3楼-- · 2019-04-03 03:57

In your local.xml file add the below code to add a custom header to the checkout page

<checkout_onepage_index>
    <reference name="root">
      <block type="page/html_header" name="header" as="header" template="page/html/your_new_header_file_name.phtml"/>
    </reference>
</checkout_onepage_index>

Now create a new_header.phtml in app/design/frontend/default/default/template/page/html and add the custom header contents in this file. Now update your new header file name in the above template field.

You can replace default/default with your_package_name/your_theme_name

查看更多
登录 后发表回答