Close

Profile: mlanglois

Avatar

User posts

7 years ago

Thanks,
I will look into it!

7 years ago

Hi,
One of our customer is using MegaMenu for NOP Commerce 3.60. They got lots of categories, they change often and the maintenance of a display order is a huge work. What our customer want is really simple. Order the category by name! We noticed that they are currently ordered by DisplayOrder,ID. With the use of the .cshtml we where able to add a .OrderBy clause. Unfortunately, in CategoryMenuTemplateWithPictures.cshtml, the Top menu is list in a For Loop and I cant find the trick to do an OrderBy for that. Also when that category is passed to the CategoryDataTable I cant find a way to Order them there also since I dont see any Foreach or loop.  For the 3rd level there is a ForEach call and there it's working great.

Any insight of what could be done? At the moment we have put an SQL Trigger to the category table that set the displayorder but I would prefer having it in the code directly.

Thanks!