In Magento, when the user directly accesses the product page, such as from Google, the breadcrumbs would only be “Home” -> “Product Name”.
How can I add categories in there even when users access the page directly from Google?
For example, on this page, I want to add the categories “Wedding Apparel” and “Wedding Dresses” in the breadcrumbs. I came up with an idea other than hard editing breadcrumbs.phtml but is there any way I can programmatically add a breadcrumbs item in template/catalog/product/view.phtml ?
I can get the categories (title and link) of the current product and then use some function / method to add them in the breadcrumbs dynamically and programmatically. Is this possible?
Here’s the code that forces Magento to display the complete breadcrumb, including categories by looping trough each category for the current product:
© Danny Vince