cancel
Showing results for 
Search instead for 
Did you mean: 

Modify the Breadcrumbs in PDP Page

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Modify the Breadcrumbs in PDP Page

I need to modify my breadcrumb in the PDP page. 

For Ex., A product named as Honey which is resided under the category Liquid. 

After clicking that Honey the breadcrumbs has to be Home->Liquid->Honey.

How to do that? Please Suggest.

10 REPLIES 10

Re: Modify the Breadcrumbs in PDP Page

Hello @anand_v

 

That is a default feature of Magento 2:

 

Like if you have a product honey under category then it will show breadcrumbs on PDP page like:

Home > Category name > honey

 

 

Manish Mittal
https://www.manishmittal.com/

Re: Modify the Breadcrumbs in PDP Page

@anand_v

 

If you are using Magento 2.1.1 then this Magento core issue, check here:

https://github.com/magento/magento2/issues/7967

 

Workaround:

https://gist.github.com/mbahar/82703c4b95d924d9bc8e6990202fdeba

Manish Mittal
https://www.manishmittal.com/

Re: Modify the Breadcrumbs in PDP Page

Hi @Manish Mittal.

My magento version is 2.2.0 and i am modifying my question i.e., Consider Liquid as an attribute and i need Home->Liquid(Attribute name)->Honey.

Please review and suggest.

Re: Modify the Breadcrumbs in PDP Page

Hello @anand_v

 

You have to customize breadcrumbs file then, please follow below tutorial to override file:

 

https://github.com/gr33nart/m2_greenart_breadcrumbs

 

after override, you can call attribute and add in breadcrumbs. 

Manish Mittal
https://www.manishmittal.com/

Re: Modify the Breadcrumbs in PDP Page

Hi @Manish Mittal.

I'm using magento 2.2.0 and after clicking the product that is present in the homepage has the breadcrumbs as Home->Honey. How to get exact full path of the Honey in the breadcrumbs of the pdp page.

Re: Modify the Breadcrumbs in PDP Page

@anand_v

 

Can you please share exact scenario, which attribute of product you want to show in breadcrumbs and what will be logic

Manish Mittal
https://www.manishmittal.com/

Re: Modify the Breadcrumbs in PDP Page

Hi @Manish Mittal.

Consider Brand as a product attribute. Water Bottle is a product inside the Brand.

If i navigates to Water bottle from Home->Brand, The breadcrumbs should be Home->Brand->Water Bottle. But it shows Home-> Water Bottle.

Please suggest and review.

Re: Modify the Breadcrumbs in PDP Page

Hello @anand_v

 

Get brand name and URL in breadcrumbs file and then add them as follows:

Suppose you stored value in $brand variable  

 

<?php elseif($_crumbInfo['last']): ?>
<a href="<?php echo $brand['link'] ?>" title="<?php echo $this->htmlEscape($brand['title']) ?>"><?php echo $this->htmlEscape($brand['label']) ?></a>
<span>&gt;</span>
<strong><?php echo $this->htmlEscape($_crumbInfo['label']) ?></strong>

Try this.

 

Manish Mittal
https://www.manishmittal.com/

Re: Modify the Breadcrumbs in PDP Page

Hi @Manish Mittal

Greetings,

I added new breadcrumb link in product page but it is displaying after the product name. I need the link before the product name.

Currently it is like Home -> Product name -> Custom link. But need like this Home -> Custom link -> Product name

 

Note: Iam using Magento 2.2.0 version

Could you provide any suggestion?

 

Thanks