Question

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.
Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top