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.
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
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
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.
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.
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.
Can you please share exact scenario, which attribute of product you want to show in breadcrumbs and what will be logic
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.
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>></span> <strong><?php echo $this->htmlEscape($_crumbInfo['label']) ?></strong>
Try this.
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