Footer does not appear correctly
-
20-12-2020 - |
Question
I have several footer
and several header
for different pages and I insert them through XML as follows in my local.xml:
<checkout_cart_index>
<reference name="header">
<action method="setTemplate">
<template>page/html/header_checkout.phtml</template>
</action>
</reference>
<reference name="footer">
<action method="setTemplate">
<template>page/html/footer_checkout.phtml</template>
</action>
</reference>
</checkout_cart_index>
The header
is working perfectly, but the footer
is not. For example, I load the home with a footer
and I go to the page of the cart, even adding it by XML, it finishes that the footer
of the home continues to appear in the cart. Thanks in advance.
Solution 2
I solved this problem by changing the way in which I insert the phtml of the footer
contained in the page from the following code through XML
:
<reference name="root">
<block type="page/html" name="footer" as="footer" template="page/html/footer_checkout.phtml" />
</reference>
Complete Code:
<checkout_cart_index>
<reference name="header">
<action method="setTemplate">
<template>page/html/header_checkout.phtml</template>
</action>
</reference>
<reference name="root">
<block type="page/html" name="footer" as="footer" template="page/html/footer_checkout.phtml" />
</reference>
</checkout_cart_index>
OTHER TIPS
You have set the footer of the homepage for all pages, this is why you find it also in cart.
- Try to find if you have some theme config in admin (Theme settings)
- find in your local.xml inside
<default></default>
some footer setting and move it in the the correct layout handle instead of<default>
app/design/frontend/{package}/{theme}/layout/local.xml
<checkout_cart_index> <reference name="footer"> <action method="setTemplate"><template>page/html/footer_checkout.phtml</template></action> </reference> </checkout_cart_index>
Clear the caches and it should work.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange