Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I display attributes on breadcrumbs? 
 
cksweetmag
Jr. Member
 
Total Posts:  1
Joined:  2012-02-15
 

Hi All,

I am having trouble trying to display the manufacturers attribute(brand) to display on the site breadcrumb.

for example

http://www.applecrumbyandfish.com/index.php/baby-care.html?manufacturer=92

currently breadrumb is

Home > Baby Care

However, it should show

Home > Baby Care > Absolutely Gorgeous

Does anybody know what to do?

Appreciate all your help.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
francoisd
Member
 
Total Posts:  39
Joined:  2009-10-14
 

Hi,

I was looking for it too.
How to display an attribute value in the breadcrumbs : brand, size etc....

Ok so I found the solution.
It works for all type of attributes, even a select attribut (attribute in a list).

Go to App, code, core, Mage, Catalog, Helper, Data.php. Copy Data.php.
Paste it in App, code, local, Mage (create it if it don’t exist), Catalog, Helper, Data.php

In this way we overload the default file. So it’s clean for updates.

Then In App, code, local, Mage, Catalog, Helper, Data.php,
open data.php to edit it.

Find the code (around line 117) :

if ($this->getProduct()) {
                $path[
'product'= array('label'=>$this->getProduct()->getName());
            
}

Modify it in order to have :

if ($this->getProduct()) {
                $label
=$this->getProduct()->getName(); /* we keep the name */
                                
$label.= " ".$this->getProduct()->getAttributeText('myattributename')." "/* here we add our attribute - so edit myattributename to brand, size or what you want - it MUST be the exact name of your attribute */
                
$path['product'= array('label'=>$label);
}

Save, and refresh your page, it’s done !!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top