How to : Add breadcrumbs in my Magento cart page

Hi buddies,
Today I just checked my new theme with magento. Still it needs a lot of update. I am just learning. Sharing knowledge means caring to me. So I am happy to share my experience with you.

By default magento not shows breadcrumbs in my cart. To add breadcrumbs there you need core hack. Though its not wise coz after upgrading it will vanish. To keep this in mind I do the hack in core. Do as follows for add breadcrumbs to my cart on your magento installation.

Add the following code in app/code/core/mage/checkout/block/cart.php

public function _prepareLayout() {
 if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) {
 $breadcrumbs->addCrumb('home', array('label' => __('Home'), 'title' => __('Go to Home Page'), 'link' => Mage::getBaseUrl()));
 $breadcrumbs->addCrumb('cart', array('label' => 'My Cart', 'title' => 'My Cart'));
 }
 }

Now go to my cart, Bingo you got the breadcrumbs there!!! 🙂

(Visited 60 times, 1 visits today)

Leave a comment

Your email address will not be published. Required fields are marked *