The 5th annual nopCommerce conference will take place in India on the 10th-11th of October. Please find more about this event here

Incorrect breadcrumb for products in multiple categories

Posted: January 13, 2011 at 5:06 AM Quote #33475
I am using nopCommerce 1.8. I have noticed that when a product is assigned to multiple categories, the breadcrumbs do not show the correct path to the product. Having a look at other topics in this forum I have seen that nopCommerce uses the first category the product is assigned to.

Is there any possibility to solve this behaviour with nopCommerce 1.8 or with a more recent version?

Thank you.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: January 13, 2011 at 1:24 PM Quote #33499
it's still like that with v1.9
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: January 20, 2011 at 8:35 AM Quote #33891
For those who might be interested, this is the solution I have chosen:

These two modules:

\Modules\CategoryNavigation.ascx.cs
\Modules\ProductCategoryBreadcrumb.ascx.cs

take the 'ProductID', find the first category the product is assigned to and that is the category shown in the menu and breadcrumbs.

I save the last 'CategoryID' in a Session variable in those two modules. Instead of taking the first category assigned to a product, I try to find the last saved 'CategoryID' in the list of categories assigned to the product. If I find it I use that category instead of the first one.

It is not perfect, but does the trick in most of the cases.

I hope it helps someone.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: February 10, 2011 at 4:26 AM Quote #35156
Hi r_razquin

Would you please post the code for this solution!

Regards,
EK
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: January 13, 2013 at 11:14 PM Quote #87221
Here is how I solved it: var cacheModel = _cacheManager.Get(cacheKey, 0, () => {
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2019
Learn more