0
votes

Another Magento issue - there seems no end to them.

This time the top menu navigation class 'active' and breadcrumbs seem to appear/disappear depending on the user journey (I guess due to page caching).

Example...

If I'm on the homepage and click an product from the 'New Products' widget - the breadcrumb becomes: Home > New Product Name (missing out the 'clothes / Tops / Long-sleeved' etc), plus the navigation active class is not appearing.

If I view that very same product first by navigating through the shop categories, then I return to the homepage and click the same product from 'New Products' - the breadcrumb works fully, and the active class is applied in the navigation menu correctly.

Why is this? What is happening and how can I fixed it?

Any advice much appreciated.

EDIT 1: in addition, if I navigate to a product through the categories in the menu, click into a different category (outside of the products root cat), then hit the back button on the browser... the same thing happens, breadcrumb reduced to 'home / product name' and the menu active class disappears.

1

1 Answers

1
votes

Not sure if this is an 'issue' or a feature. Magento can have the same product in multiple categories. So Product A can be in the root category, Category 1 > Subcategory 1 and Category 2, all at the same time. What should be the url then? You have the following options:

  • website.com/ProductA.html
  • website.com/Category1/ProductA.html
  • website.com/Category2/ProductA.html
  • website.com/Category1/Subcategory1/ProductA.html

None of them are 'wrong' and doesn't even stop here, imagine a multistore environment where two stores have the same root category, but different domains and languages:

  • website.com/ProductA.html
  • website.com/Category1/ProductA.html
  • website.com/Category2/ProductA.html
  • website.com/Category1/Subcategory1/ProductA.html
  • website.org/ProductA.html
  • website.org/Category1/ProductA.html
  • website.org/Category2/ProductA.html
  • website.org/Category1/Subcategory1/ProductA.html

etc.

Conclusion, if you really want the breadcrumbs and active-class to appear when clicking on a product from the 'New Products'-widget, you have to modify the widget's block so that it prints the product URL in a customized way.