Magento 2 Sort Direction per Category
SKU: CATEGORYSORTDIRECTION1
- Set ascending or descending right in the category form
- Inheritance for subcategories, overridable where needed
- The visitor's choice always wins
- Correct arrow in the Hyvä toolbar, no extra JavaScript
Einmaliger Kauf · inkl. 12 Monate Updates · zzgl. MwSt.
Magento 2 sort direction per category: the missing piece of default sorting
When you create a category in Magento 2 you can choose a default sort field, such as price, name or position. The matching Magento 2 sort direction cannot be set per category, though. As a result new arrivals may start with the oldest product on top, or the cheapest items sit at the very end until the visitor touches the toolbar. That costs clicks and revenue.
Mironsoft Category Sort Direction is a Magento 2 extension for Hyvä shops that closes exactly this gap. It adds a direction field to the category form, inherits the value down to subcategories and adds a global default per sort field. Mironsoft sets the module up in your shop.
Features of the Magento 2 sort direction at a glance
Magento lets you pick the sort field per category, but not the Magento 2 sort direction. This module closes exactly that gap.
Direction per category
Ascending or descending, right in the category form under the display settings.
Inheritance
Subcategories adopt the direction of their parent until they get a value of their own.
Default per sort field
A global rule such as “price ascending, newest descending” applies whenever a category sets nothing.
Visitor choice counts
If a visitor sorts manually, their selection applies. Your setting is only the starting state.
Hyvä toolbar
The direction arrow shows the real state from the first view, via Alpine.js and without an extra script.
Cache and SEO safe
The Magento 2 sort direction creates no new parameter URLs, canonical tags and the full page cache work as before.
Set the Magento 2 sort direction right in the category form
The category form gets an extra field “Default sort direction” under the display settings, with the values Inherit, Ascending and Descending. It works together with the existing “Default product listing sort by” field and needs no maintenance anywhere else.
- Values: Inherit, Ascending, Descending
- Works per store view, e.g. a different direction in an outlet store
- New categories start with “Inherit”
One value in the tree, many categories controlled
Set the direction once on a top-level category and all subcategories adopt it. Where a category has neither its own nor an inherited value, the global default per sort field from the configuration applies, and finally the stock Magento behaviour.
- Priority: own value, parent category, default per sort field, Magento default
- Single subcategories can deviate on purpose
- No data migration, existing categories stay untouched
Visitor choice stays in charge: set a default without being pushy
The module only decides how a listing is sorted when nobody has chosen anything. If a visitor picks another sort field or direction in the toolbar, the URL parameter applies as before. The search results page stays on relevance so result quality does not suffer.
- Search results are not modified
- Sorting by “Position” can be excluded from the direction rule
- No reindex needed, clearing the category cache after saving is enough
Magento 2 sort direction in the Hyvä toolbar and the full page cache
The Hyvä toolbar receives the starting direction on the server and shows the arrow correctly from the first paint, without a script flipping the state afterwards. The full page cache stores the category as usual, because the direction belongs to the category and not to the visitor.
- Toolbar arrow and label match the starting state
- No flicker after load
- Category cache tags are cleared on save
Where the Magento 2 sort direction per category pays off in practice
New arrivals and promotions
A “New in” category sorts by creation date descending so the newest product comes first, without anyone maintaining positions.
Price entry point in the outlet
In an outlet or clearance area the cheapest item comes first. The right Magento 2 sort direction speaks to price-conscious visitors immediately and lowers bounce rates.
B2B and spare parts
Part numbers or article names ascending: buyers find positions in the familiar order without switching the toolbar.
Seasonal categories
Popularity first before Christmas, price first in summer. You change the direction on the category in seconds, not in code.
Magento 2 default vs. Magento 2 sort direction with the module
The table shows what changes in daily work once the direction becomes controllable per category.
| Criterion | Without the module | With the module |
|---|---|---|
| Direction per category | Not provided, one value for all | Ascending, descending or inherit |
| Subcategories | Each one separately, no inheritance | Parent category value is adopted |
| Default per sort field | Not possible | Global rule, e.g. price ascending |
| Visitor sorts manually | Works | Works unchanged, takes priority |
| Changes by editors | Developer needed | Directly in the category form |
| New URL variants | Not relevant | None, the starting state belongs to the category |
Setting up the Magento 2 sort direction in four steps
Alignment
Together we clarify which categories should get which Magento 2 sort direction.
Setup
Mironsoft installs the module in your shop and creates the global defaults.
Testing
We check categories, subcategories, search and Hyvä toolbar on a staging system.
Handover
You get a short walkthrough, afterwards your editors maintain the direction themselves.
No download — personal setup instead
Mironsoft Category Sort Direction is not listed here as a ready-made download file for self-installation. The purchase is a service commission: we get in touch with you after the purchase, install the module in your shop, and agree together on which categories get which Magento 2 sort direction and whether the global defaults per sort field are set.
Frequently asked questions
Everything you need to know about scope, priority of the visitor's choice and the purchase process.
How can I set the sort direction per category in Magento 2?
How do I sort a category descending by default in Magento 2?
What happens when a visitor sorts manually?
Does the sort direction affect search results?
Does the setting apply to subcategories too?
Does it replace an extension with additional sort options?
Does the Magento 2 sort direction work with Hyvä?
Do I need to reindex after saving?
Can the direction differ per store view?
Can I download and install the module myself?
Magento 2 sort direction – Mironsoft Category Sort Direction