If I open a product directly from Home or search page then breadcrumb shows like this:
Home > MyProduct
Whereas if I go to the category, then subcategory and then open the product, it show the Breadcrumb like this:
Home > Category1 > Category2 > MyProduct
I need to make the breadcrumb with full hierarchy regardless of from where I am coming to product page.
Please help me achieve this
Best Answer
First you have to add block in your module
Path:
app\code\Vendor\Module\Block\Crumbblock.php
After that add layout file
catalog_product_view.xml
in your module Path should be:app\code\Vendor\Module\view\frontend\layout\catalog_product_view.xml
After that Add phtml file in your module Path Should be like:
app\code\Vendor\Module\view\frontend\templates\crumbs.phtml
I hope this will help