在Magento(1.8.x)中为Checkout页面添加自定义标题 [英] Add custom header for Checkout pages in Magento (1.8.x)
问题描述
我正在尝试向自己的Checkout页面添加自定义标头,我发现从页面中删除标头基本上是在/layout/checkout.xml文件中添加了一个节点,任何人都可以解释一下如何对新内容进行修改标头仅适用于所有Checkout页面.
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.
当前默认值/布局/checkout.xml
Current default/layout/checkout.xml
<default>
<remove name="footer"> <!-- removes the footer from checkout -->
... // all other xml data..
</default>
我主题的伪代码
if (a CHECKOUT PAGE) {
use 'custom checkout header'
else
use the standard default header.
推荐答案
在您的local.xml
文件中添加以下代码,以将自定义标头添加到结帐页面
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>
现在在app/design/frontend/default/default/template/page/html
中创建一个new_header.phtml
,并将自定义标头内容添加到此文件中.现在,在上面的模板字段中更新新的头文件名.
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.
您可以将default/default
替换为your_package_name/your_theme_name
这篇关于在Magento(1.8.x)中为Checkout页面添加自定义标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!