Replacing header.phtml with new checkout_header.phtml in local.xml - magento

I've copied the code from this answer but still cant change the header code, I'm only getting the standard header.phtml file.
Add custom header for Checkout pages in Magento (1.8.x)
I cant tell if magento is not reading my local.xml file (I've refreshed all caches etc) or if I'm missing something from the code. I've tried several varations of code from searches (as below) but none are working. I'm trying to do it all in local.xml, without editing other template files.
do i need to tell magento to read my new local.xml file? Should I remove the old header first?
<checkout_onepage_index>
<reference name="root">
<block type="page/html_header" name="header" as "header">
<action method="setTemplate"><template>page/html_checkout_header.phtml</template></action>
</block>
</reference>
</checkout_onepage_index>

You should use the header reference instead of defining a new block named header. This should update the existing header block by referencing it and applying the change.
<?xml version="1.0"?>
<layout version="0.1.0">
<checkout_onepage_index>
<reference name="root">
<reference name="header">
<action method="setTemplate"><template>page/html_checkout_header.phtml</template></action>
</reference>
</reference>
</checkout_onepage_index>
</layout>
Also trivial, but make sure page/html_checkout_header.phtml actually exists inside of the theme's template folder you are using.

Related

local.xml is not loading in magento

I want to delete the recently viewed products at the category view page. I have created my local.xml in public_html/app/design/frontend/base/default/layout
I have looked at several potential solutions on the internet but nothing seems to work. I use the following code at the moment:
<default><reference<reference name="right">
<remove name="right.reports.product.viewed"/> </reference> </default>
I also have tried left, but not seems to work. Could someone help me how to succeed loading local.xml? Thank you.
The above solution even if written correctly, will remove the right side reports view from all the pages (I am hoping that this needs to be removed only from CATEGORY VIEW page).
Firstly, create local.xml file in custom theme folder. I would suggest creating custom package too like below:
/app/design/frontend/customPackage/customTheme/layout/
However, since you are using BASE
/app/design/frontend/base/default/layout/local.xml
The code must be as below:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<catalog_category_default>
<reference name="right">
<remove name="right.reports.product.viewed"/>
</reference>
</catalog_category_default>
</default>
</layout>
This will work only if the template for is set to 2columns-right.phtml
Hope this helps.
Happy Coding...
If you installed a theme try to copy local.xml file to theme's layout directory
like this "\app\design\frontend\THEME_DIR\layout\local.xml"
also you have a syntax error in your xml
it should be:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="right">
<remove name="right.reports.product.viewed"/>
</reference>
</default>

Edit template layout in Magento

I'm trying to edit the right sidebar of the homepage of a site based on Magento. When I edit the Layout Update XML field in the Custom design part of the homepage, I see this code:
<reference name="right">
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
<action method="unsetChild"><name>right.newsletter</name></action>
<action method="unsetChild"><name>cart_sidebar</name></action>
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page"/>
</reference>
But I can't find where would be the layout specified in the block tag. When I remove the whole code, the sidebar is still displaying but with the Compare Sidebar Widet on top of the rest of teh sidebar.
I'm new to Magento and a little bit lost. Thank for your help.
use this
<remove name="catalog.compare.sidebar"/>
in default
like this
<default>
<reference name="right">
<remove name="catalog.compare.sidebar"/>
</reference>
</default>
it will work
The best way to accomplish is to create local.xml file under your themes layout section and paste this code. So you do not need to search in all the files.
<layout version="0.1.0">
<default>
<!-- remove compare sidebar -->
<remove name="catalog.compare.sidebar"/>
</default>
</layout>

How to remove 'Orders and Returns' from the footer?

I've updated a fresh Magento 1.5.0.1 installation to Magento 1.6.0.0, and now I've got a link in the footer, "Orders and Returns", that I can't figure (yet) how to remove that.
I can't remove it from the core files, I've tried the XML method but doesn't seems to work (probably my fault).
At the moment I can't even localize where the link is generated, as simple tests (like putting random words where the output should appear) never works.
Anyone got any suggestion or a solution about?
You could try:
<layout>
<default>
<reference name="return_link">
<!-- Set the template file to an empty string to prevent output -->
<action method="setTemplate">
<template></template>
</action>
</reference>
</default>
</layout>
Or in 1.7+:
<layout>
<default>
<reference name="footer_links">
<action method="removeLinkBlock">
<blockName>return_link</blockName>
</action>
</reference>
</default>
</layout>
Or, as mentioned by Rumble:
<layout>
<default>
<remove name="return_link" />
</default>
</layout>
One caveat about using remove element is that it would prevent the usage of that block name anywhere in the layout as it is converted into a global xpath selector.
Here the solution.
Since I needed to keep it theme related, I duplicated the layout sales.xml from app/design/frontend/base/default/layout/ to my theme layout folder (app/design/frontend/default/<name>/layout/) and commented out the <action> element from following snippet:
<default>
<reference name="footer_links">
<block type="sales/guest_links" name="return_link"/>
<action method="addLinkBlock"><blockName>return_link</blockName></action>
</reference>
</default>
Enjoy!
There's a really simple way to remove this link. Add the following to your theme's local.xml
<default>
<remove name="return_link"/>
</default>
There's a good introduction to using local.xml here.

add step to checkitout

My company have just baught Ivan's CheckItOut extension, and I'm trying to add a step in it.
Actually, I did have this step integrated into "regular" OPC.
Looking at the extension's code, I see that there is a addCheckoutStepToLayout method used in the layout checkitout.xml file. If I had this line into checkout.layout block:
<action method="addCheckoutStepToLayout"><layout>right-bottom</layout><step>points</step></action>
the step is added, but I'm trying to add it via my extension layout .xml file.
So I've tried updating the checkitout handle:
<ecomdev_checkitout_layout>
<reference name="content">
<reference name="checkout.layout">
<action method="addCheckoutStepToLayout"><layout>right-bottom</layout><step>points</step></action>
</reference>
</reference>
</ecomdev_checkitout_layout>
updating the block through regular checkout_onepage_index handle:
<checkout_onepage_index>
<reference name="content">
<reference name="checkout.layout">
<action method="addCheckoutStepToLayout"><layout>right-bottom</layout><step>points</step></action>
</reference>
</reference>
</checkout_onepage_index>
with and without <reference name="content">, but no luck until now.
I'd be glad reading your suggestions, thx
Eventually I asked the author directly, and the solution was quite simple.
The block wasn't created yet when I was trying to update it through my module's layout file: I've made it depends on Ecomdev_Checkitout and everything is working fine now.

Magento - Changes to Edit Account Information screen do not get reflected

I have my custom theme, in which I would like to make changes to the Edit Account Information Screen. I have tried to modify this file:
customer/form/edit.phtml
No change that I make to this file gets reflected. I even removed all customer/form/edit.phtml files from the base and my custom theme. Even then, the screen renders.
This is the relevant code in my customer.xml file:
<customer_account_edit translate="label">
<label>Customer Account Edit Form</label>
<update handle="customer_account"/>
<reference name="root">
<action method="setHeaderTitle" translate="title" module="customer"><title>Edit Account Info</title></action>
</reference>
<reference name="my.account.wrapper">
<block type="customer/form_edit" name="customer_edit" template="customer/form/edit.phtml"/>
</reference>
<reference name="left">
<action method="unsetChild"><name>left.permanent.callout</name></action>
</reference>
</customer_account_edit>
What am I missing?
I found what was happening. I have an extension installed which has the following code:
<customer_account_edit translate="label">
<reference name="head">
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/></action>
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
</reference>
<reference name="content">
<block type="core/html_calendar" name="head.calendar" as="html_calendar" template="aitcheckoutfields/js/calendar.phtml"/>
</reference>
<reference name="customer_edit">
<action method="setTemplate"><template>aitcommonfiles/design--frontend--base--default--template--customer--form--edit.phtml</template></action>
</reference>
</customer_account_edit>
I commented out this code and now my edit.phtml is being used to render the form. I still do not understand, however, which phtml file this refers to?
Aitoc sometimes uses a funky rewrite method to generate template files for their modules. I had the same issue and eventually found my .phtml file in /var/ait_patch/design/frontend/default/default/template/aitcommonfiles
When files are missing from your custom theme the template system falls back to the equivalent files in the default/base theme. Also, Magento caches this so when new files are introduced it won't notice straight away and continue using the base files instead. Make sure you turn off all caches when developing.

Resources