Inhalte aufrufen

Profilbild

Sorting categories alphabetical

button entfernen home

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
4 Antworten zu diesem Thema

#1 Yoram

Yoram

    Advanced Member

  • Members
  • 33 Beiträge

Geschrieben: 01 May 2020 - 11:20

Hello,

 

I want to order the categories in alphabetical order. Right now if i go to my categorie overview the categories in the left horizontal bar are sorted the way i want. But the thumbnails on the right not. I can find any setting to do so.

 

Usefull to know is that i use the Alias field in a catagorie item to sync the categories with our backend database. And if i look in the tree view of the categories at the admin page(catalog > categories), the categories are sorted by alias and not by its name.

 

Is this something is can fix with a setting?


Smartstore: Website | Webshop


#2 stefanmueller

stefanmueller

    SmartStore AG

  • Administrators
  • 245 Beiträge

Geschrieben: 04 May 2020 - 10:46

Hello Yoram, not shure how you need it. Could you attach a screenshot please? Thank you! Greetings, Stefan



#3 Yoram

Yoram

    Advanced Member

  • Members
  • 33 Beiträge

Geschrieben: 04 May 2020 - 13:34

I've uploaded a screenshot. As you can see, the problem is partially solved. I have changed the display order for each category so the shop now sorts it correctly. But there must be a way to sort the categories (marked red) alphabetically?

 

Knipsel.jpg


Smartstore: Website | Webshop


#4 altmoola

altmoola

    Advanced Member

  • Members
  • 66 Beiträge

Geschrieben: 06 May 2020 - 17:03

I had to change this on mine too. One way to do this is to go to the CategoryTemplate.ProductsInGridOrLines.cshtml view and change the line:

@foreach (var item in Model.SubCategories)

to

@foreach (var item in Model.SubCategories.OrderBy(x => x.DisplayOrder).ThenBy(x => x.Name))

Then reset all your DisplayOrder values to 0 and it will then sort by name by default.



#5 Yoram

Yoram

    Advanced Member

  • Members
  • 33 Beiträge

Geschrieben: 07 May 2020 - 08:36

Thanks for your answer altmoola! I will discuss with our IT deparment to apply the change.

 

Altough, i think it is a good option to have this option in the settings on the admin page.


Smartstore: Website | Webshop



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: button, entfernen, home