Magento - 为购物车页面添加面包屑导航(breadcrumb)
拷贝文件/app/code/core/Mage/Checkout/Block/Cart.php到/app/code/local/Mage/Checkout/Block/Cart.php,打开拷贝过来的Cart.php,添加以下代码
public function _prepareLayout() { if ( ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) ) { $breadcrumbs->addCrumb('home', array('label'=>Mage::helper('cms')->__('Home'), 'title'=>Mage::helper('cms')->__('Go to Home Page'), 'link'=>Mage::getBaseUrl())); $breadcrumbs->addCrumb('cart', array('label' => 'cart', 'title' => 'cart')); } return parent::_prepareLayout(); }
效果
最后更新:2017-04-02 06:51:19