Developer forum

Forum » Ecommerce - Standard features » Sorting product groups

Sorting product groups

Thomas Overgaard Nielsen
Reply

Hi all

This should be really simple but I cannot seem to get it working:
In the group list template of a product catalog I would like to list product groups in the same order as in backend.
In the settings of the product catalog module I set sortorder to UserDefined but this only affects the product listing. The groups are listed in the same order as created.
I can get it to work, if I either manually select the product groups to list in the module settings (which is inconvenient) OR if I deselect "include subgroups" which is not what I want. 

I have looked into sorting groups by razor instead. Eg:
      var groupList = GetLoop("Groups").OrderBy(x => x.GetString("Ecom:Group.Name"));
.. but this way I don't seem to be able to sort by UserDefined (?)

Any takes on this?
I am on DW 8.7.0.1

Regards
Thomas


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Thomas

That is because when you check that box, we get groups from several levels that each has its own sorts. So it could be displaying these groups in one big list - it does not makes much sense to sort by sort order.

  • Group A (sort 1)
    • Subgroup A1 (sort 1)
    • Subgroup A2 (sort 2)
  • Group B (sort 2)
    • Subgroup B1 (sort 1)
    • Subgroup B2 (sort 2)

How would you expect this list to be sorted?

Votes for this answer: 1
 
Nicolai Høeg Pedersen
Reply

Also consider that groups can be in more than one place in the tree - having more than one sort value...

 
Thomas Overgaard Nielsen
Reply

Hmm .. you've got some really good points. There are severel right answers to your questions :)

In my implementation i filter the group list in my template such that only first level groups are shown. That's why I didn't think of the implications .)
A click on a first level group lists all products in that group AND subgroups (hence the need to include subgroups in the settings) with the ability to further narrow down the list with search filters.

But thanks for your answer :)

 

 
Thomas Overgaard Nielsen
Reply

.. the interesting part is, that when manually selecting groups in the module settings, all first level groups are listed in the same way as in the backend .. then second level.
This is only one possible way to do it, but it happens to be how I would have liked it :) 

 

 

You must be logged in to post in the forum