0

In my local.xml file, I added the code to hide the breadcrumbs and all pages show fine without the breadcrumbs except Orders and Return page does not display at all. After removing the breadcrumbs code in local.xml, the page displays fine. I'm using Magento 1.9.0.1. How can I solve this issue?

Here is the local.xml file

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <default>
        <remove name="right.reports.product.compared" />
        <!--recently compared prod-->
        <remove name="left.reports.product.viewed" />
        <!--removes recently viewed sidebar-->
        <reference name="header">
            <remove name="breadcrumbs"/>
        </reference>
    </default>
</layout>
2
  • please show your local.xml file. Without looking into code, how can we help you ! – Rajeev K Tomy Dec 1 '14 at 3:42
  • <?xml version="1.0" encoding="UTF-8"?> <layout> <default> <remove name="right.reports.product.compared" /> <!--recently compared prod--> <remove name="left.reports.product.viewed" /> <!--removes recently viewed sidebar--> <reference name="header"> <remove name="breadcrumbs"/> </reference> </default> </layout> – MeanJ Dec 1 '14 at 22:01
1

The issue is that the Guest helper in the Magento core Sales module is trying to set the breadcrumb for Order & Returns without first checking if the breadcrumb block is valid. Because you're removing the block it no longer exists and trying to set a crumb on it fails.

To fix this, copy the Guest helper file app/code/core/Mage/Sales/Helper/Guest.php (core code pool) into app/code/local/Mage/Sales/Helper/Guest.php (local code pool).

Then, edit the local code pool copy of the file and replace the getBreadcrumbs() method starting at line 140 with this:

public function getBreadcrumbs($controller)
{
    $breadcrumbs = $controller->getLayout()->getBlock('breadcrumbs');
    if ($breadcrumbs) {
        $breadcrumbs->addCrumb(
            'home',
            array(
                'label' => $this->__('Home'),
                'title' => $this->__('Go to Home Page'),
                'link'  => Mage::getBaseUrl()
            )
        );
        $breadcrumbs->addCrumb(
            'cms_page',
            array(
                'label' => $this->__('Order Information'),
                'title' => $this->__('Order Information')
            )
        );
    } else {
        return;
    }
}

This adds a check to see if the breadcrumbs exist before trying to add a crumb and should allow the Orders & Returns page to work.

2
  • Thank you very much. I did a backup copy of the Guest.php core file and made the change there and everything working now. – MeanJ Dec 3 '14 at 3:05
  • Glad to here it! Since this solved your issue please go ahead and accept the answer so that this questions will show as resolved. – Rob Dec 3 '14 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.