Magento 2 Improved Sorting Extension
Improved Sorting lets you decide which products shoppers see first on category pages, search results and catalog widgets. Combine signals like sales, rating, stock, margin and newness into one sort order, pin chosen products to the top, and push out-of-stock items and products without images to the end.
- Pin products to the top of any category
- Promote seasonal, high-margin, or discounted products
- Demote out-of-stock products and products without images
- Create product sorting options based on any product variable
- Sort products on category pages, search pages, and inside widgets
Business Value
Decide what shoppers see first
How you sort your products directly affects your store's UX and conversion rate.
Customers need to find what they are looking for quickly and easily, or they leave. On top of that, the products you need to sell should be near the top, not wherever Magento's position field happens to put them.
Improved Sorting lets you decide what fills the first row: products that sell, products with a good margin, new arrivals or stock you need to move. Out-of-stock items and products without images go to the end.
How It Works
Set up your ranking factors based on whichever product variable you require – from attributes to sales numbers. These factors convert each variable into a score between -100 and 100, determining the product's position.
Once you have set up the ranking factors, you can create sorting criteria based on them. You can include as many ranking factors as you need in a single sorting criterion.
The module shows the sorting criteria you create as sorting options on the frontend, so shoppers get options built around your catalog.
A comparison between sorting products with default Magento sorting options and sorting them with Mirasvit Magento 2 Improved Sorting extension.
Magento 2 Product Sorting for Merchandising
Highlight any product you need
Move the products you need to sell up the list: goods with surplus inventory, a new collection or under-sellers that deserve a second look.
Keep chosen products at the top of a category
Pin chosen products to the top of any category. They stay above every sorting rule, and the rest of the category sorts as usual below them.
Sort by the most relevant criteria
Replace Magento's Position, Name and Price dropdown with options shoppers actually use: Bestsellers, Top Rated, Newest, Biggest Saving. Search can get its own default.
Fill the first row with products that sell
Put in-stock, well-reviewed bestsellers in the first row instead of products that only rank there because of their position number in the category.
Ranking Factors
Ranking factors are our own approach to sorting: each factor turns one product signal into a score from -100 to 100, and sorting criteria combine those scores. Any product attribute can be a ranking factor.
The ranking factor can be applied in two modes:
• as a parameter for sorting criteria;
• as a global parameter that will be applied before any other conditions for all sorting criteria.
Show newest products first
Override Magento's default sorting and rank products from newest to oldest. The Improved Sorting module lets you rank products by when you added or updated them, or by their "Set Product as New" dates. You can set the exact time window during which the module treats a product as new or recently updated (60 days by default). This is how you sort by newest and help visitors discover new arrivals.
Highlight specific products
Rank the products with particular attributes or attribute sets higher. Set up the attribute set in the Magento admin panel.
This is handy when you need more specific sorting options, like boosting seasonal products or certain brands.
Rank less attractive listings lower
Set up product sorting in your store so that customers see products with a complete product page first. This factor moves products without images to the bottom.
It's invaluable for any store, as visitors are much less likely to buy something if they don't know what it looks like.
Leverage social proof
This factor ranks products by their average review score (Magento 2 sort by rating), with the number of reviews as a tie-breaker. A separate Review Count factor ranks products by how many reviews they have.
Products with higher ratings have higher conversion rates because they appear more trustworthy.
Sort by what's selling
Rank products by the number of units sold during a time frame you set, 60 days by default (Magento 2 sort by bestseller).
This option will help you sell even more of your bestsellers or put a spotlight on underperforming products.
Sell efficiently
This factor ranks products by their profit margin, calculated from the product's price and its cost attribute.
Combine it with Bestsellers to favor items that both sell well and earn well.
Highlight any product attribute
This is the most flexible factor. It lets you use Magento conditions to give a higher ranking to products with a particular attribute or an attribute combination.
Category, size, SKU: build the condition from any of them.
Demote the products you can't purchase
The module lets you rank products by their stock status or by how many are left in stock, including MSI sources. For configurable products, a separate factor counts how many child products are in stock, and another one handles backorders.
Stock status is vital for any store, as visitors are more interested in products they can buy right away.
Stock quantity comes in handy if you'd like to boost the sales of slow-moving products or clear your inventory.
Improve product discoverability
This factor scores each product by its number of page views, over the last 30 days by default. Visits from search engine crawlers and AI bots are not counted, so the score reflects real shoppers.
It's very helpful if you'd like to take advantage of social proof or highlight the products visitors tend to overlook.
Highlight the most efficient products
This ranking factor prioritizes products with the highest conversion rate: sales divided by page views, over the last 365 days by default.
It comes in handy if you intend to maximize your income or give underperformers a nudge.
Provide excellent value to the customers
This factor ranks products by discount percentage, counting both special prices and catalog price rules.
It'll help you bring the most valuable promotions to the top and get the most out of your sales.
Define your own formulas to sort products
The Formula ranking factor lets you define your own calculations from product attributes and the scores of other ranking factors. The syntax is very similar to that of Excel formulas, making it easy to use and customize.
19 Ranking Factors You Can Combine
Each factor can be used on its own, combined with others in a sorting criterion or applied globally to every sorting option.
- Bestsellers
- Sales per View
- Popularity
- Rating
- Review Count
- Discount
- Profit
- Date (created, updated)
- New Product
- Stock Status
- Stock Quantity
- Child Products in Stock
- Backorders
- Image
- Attribute
- Attribute Set
- Rule
- Alphanumeric (natural sort)
- Custom Formula
Flexible Sorting Criteria for Magento 2
A sorting criterion can use any ranking factor alongside Magento's own fields: category position, name and price. So you can keep the manual product position you set in a category and still push out-of-stock items down, or sort by price low to high within each stock group.
Use the Preview option to check how the product catalog at your store is being sorted with a new ranking factor.
Tailor the sorting to your exact goals
The Magento 2 sorting extension lets you combine any number of ranking factors in a single sorting criterion.
For complex sorting criteria, the module first sorts by the main ranking factor, then it applies the next one, and so on.
Ranking factors can have complex conditions themselves. You can choose an ascending or descending sorting option for each ranking factor.
For example, you can create a rule prioritizing the cheapest and the latest-added bestsellers with the highest rating.
Customize the way the module applies the rules
Improved Sorting extension can calculate the sorting score in two different ways:
- You can add the factors as separate conditions. That way, the module will apply each of them in sequence. For example, it will start by sorting by A, then it will sort the resulting sequence by B, and so on.
- You can also add the factors as sub-conditions with weights. That way, the module adds up the factors' weighted scores and sorts by the total. For example, it will sort the products by (A + B + … + N).
You can combine both options in a single criterion.
Let visitors see the most lucrative option first
The very first sorting option that visitors see should put the most attractive products at the top.
The module allows you to change the default sorting criterion for category pages and search results pages, and to set a different default for any single category.
Advanced Magento Product Sorting Features
Teach your search how to sell
The module enhances the sorting options on search result pages, too. Add new sorting criteria to the search page and extend the list of default Magento sorting options. Until you set your own default for search, Magento's Relevance sorting stays the default there.
Worried that merchandising will push relevant results down? Turn on "Prioritize search relevance over global ranking factors", and global factors such as stock status will only break ties between equally relevant products. Sorting also applies to the suggestions in Mirasvit search autocomplete.
Improve the widgets' efficiency as well
Change how the products are sorted within catalog widgets and Page Builder product lists. Select a sorting criterion from a drop-down menu to activate custom sorting in the widget. Apply sorting criteria to each widget individually. Use the Store Views option to apply different sorting to similar widgets in different store views.
Double-check any setup easily
You can preview the product order for any ranking factor or sorting criterion you add.
In the admin panel, apply filters to the products grid to quickly see the sorting scores for a particular ranking factor or sorting criterion.
Filter the product grid by product attributes, like category, price, SKU, status, type or quantity, to find the products you need without browsing the catalog.
The list of sorting criteria also shows how often shoppers pick each option, so you know which ones to keep.
Streamline problem-solving
The debug mode shows how the module takes the sorting scores and rules into account on the frontend. The data is available in the form of the product grid. Apply filters to get to the products you want to analyze faster.
To check where a specific product lands on the frontend and why, turn on Developer Mode in the extension settings and add ?debug=sorting to the end of the page URL. You'll see each product's Global Score, Sorting Score and Sorting SubScore. Step-by-step setup is in the ranking factors guide.
Works with Your Stack
- Elasticsearch, OpenSearch and Smile ElasticSuite search engines
- Hyvä themes, with no separate compatibility package
- Headless and PWA storefronts through GraphQL and REST API
- Magento Open Source, Adobe Commerce, Adobe Commerce Cloud and Mage-OS
- Magento Visual Merchandiser: pinned products show up in its grid
- Catalog widgets and Page Builder product lists
- Mirasvit Search Autocomplete: suggestions follow your default search sorting
- Mirasvit Dynamic Categories: build categories automatically by rules and order them with these criteria in its merchandiser
| Feature | Improved Sorting | Other Extensions |
|---|---|---|
| Sorting Options | ||
| Customizable options |
Fixed set of options; no custom criteria from combined factors |
|
| Price | ||
| Bestsellers | ||
| Most Viewed/Most Popular | ||
| Top Rated | ||
| New/Recently added | ||
| Biggest Saving/Discount | ||
| Extended Features | ||
| Pin products to the top of a category | ||
| Place out-of-stock products at the end | ||
| Place products without images at the end | ||
| Preview Mode | ||
| Sorting inside widgets and Page Builder | ||
| Ranking Factors | ||
| Profit | ||
| SPV (sales per view) | ||
| Attribute Set | ||
| Custom Rules | ||
| Custom Formula | ||
Save time by starting your support request online and we'll connect you to an expert.
How do I add a custom sort option in Magento 2?
The Improved Sorting extension introduces a new concept called Sorting Criterion, which represents a single sorting option.
To add a new custom sort option to your product listings, create the sorting criteria you need. The extension applies them to all catalog pages. Five ready options (Bestselling, Date, Name, Price, Rating) can be added in one click.
How can I set a different default sorting option for a particular category in Magento 2?
By default, Magento 2 applies the global sorting option to each category, but you can change the default option for a particular category on the category edit page.
For instance, you can sort the 'Sale' category by the discount amount and the 'New Products' category by date. The same page lets you choose which sorting options a category offers.
Can I keep specific products at the top and sort the rest by rating?
Yes. Pin the products you want on the category edit page: pinned products stay at the top of the category, above any sorting criterion and the out-of-stock rule.
The rest of the category follows the criterion you choose, for example Rating.
How do I show out-of-stock products at the end of the catalog?
Use a global ranking factor for stock status. The extension applies it to all category pages, search pages and product widgets. It is created and active right after installation, together with a global factor that moves products without images down.
In the same manner, you can push products without reviews to the end of the list.
Can I automatically promote or demote products based on stock levels?
Yes. Besides stock status, you can rank products by stock quantity (regular or MSI), by the number of child products in stock for configurable products, and by backorder status. By default, Magento 2 offers none of these options.
Scores update automatically when a product is saved or ordered, and a full rebuild runs every 6 hours, so the order follows your stock without manual work.
Can I sort products by the number of sales?
Yes. The "Bestsellers" ranking factor ranks products by the number of units sold.
You choose the time frame the extension takes into account, for example the last 30 or 90 days. The default is 60 days.
How can I enable sort by rating for products in Magento 2?
The Improved Sorting extension provides a "Rating" ranking factor, one of its 19 ranking factor types.
It averages all approved ratings for each product and uses the number of reviews as a tie-breaker. Add it to a sorting criterion to give shoppers a "sort by rating" option.
How can I apply sort by popularity in the Magento 2 catalog?
Create a new "Popularity" ranking factor and add it to a sorting criterion.
This factor sorts products by the number of product page views, over the last 30 days by default. Visits from search engine crawlers and AI bots are not counted.
How do I sort products by newest in Magento 2?
Use the "Date" ranking factor. It ranks products by when they were created or updated, within a time window you set, and a separate "New Product" factor uses the "Set Product as New" dates.
See the ranking factors guide for the setup.
Does Improved Sorting keep the manual product position in a category?
Yes. Position is available as a sorting field next to the ranking factors, so a criterion can keep your manual category order and still apply rules such as "out of stock last".
What happens to Relevance sorting on search results pages?
Magento's Relevance stays the default on search pages until you choose your own default criterion for search.
If you want global factors such as stock status to only break ties between equally relevant products, turn on "Prioritize search relevance over global ranking factors".
How do I enable sort by bestseller in Magento 2?
Configure the "Bestsellers" ranking factor and set how many days of order history to consider (the default is the last 60 days). Then add it to a sorting criterion.
Does it work with Hyvä and my search engine?
Yes. It works with Hyvä themes without a separate package, with Elasticsearch, OpenSearch and Smile ElasticSuite, and with headless storefronts through GraphQL and REST API. It also runs on Mage-OS and Adobe Commerce.
?product_list_order links never land on a hidden criterion — the first visible criterion by position is used instead. Search results, autocomplete, Catalog Products widgets, Page Builder product lists and brand pages keep showing every active criterion. The new form labels are translated into all shipped languagessort_fields returns only the criteria visible on the queried category, and an mst_sort code hidden on that category falls back to the default criterion. When the default criterion (or the category's own default sort) is hidden, the first visible option becomes the default, matching the category pagemst_sorting_criterion.category_scope and new table mst_sorting_criterion_category; run bin/magento setup:upgrade. Existing criteria default to "All categories", so the storefront is unchanged until you restrict onesetup:upgrade rebuild the shared database triggersort_fields no longer fails with an error when no default sorting criterion is configured0 explicitly if the factor's data really is the same for every store viewsetup:upgrade; rows already in the current format are skipped, so it is safe to run repeatedlyBlog
We are committed to being open and transparent with our customers. When you purchase our module, you automatically receive one year of free support service and free updates.
Why is this important?
- Seamless Installation and Configuration: We understand that setting up a new module can take time to configure according to your specific needs. That’s why we offer a full year of free support. Our experienced team is here to assist you with installation, configuration, and any questions you might have. We're eager to share our expertise to ensure you get the most out of your purchase.
- Stay Updated with Magento (Adobe Commerce) Releases: Magento releases new versions approximately every three months. These updates can sometimes introduce compatibility challenges. To keep your store running smoothly, we provide a year of free access to the latest versions of our modules, ensuring that you can upgrade Magento and our modules without encountering any obstacles.
- Subscription Included: Renewing your subscription ensures continued access to the latest updates and support from our team. This means you can be confident that any issues you encounter with the extension will be resolved quickly and efficiently. You can cancel your subscription at any time without any additional fees.
These are our primary. A major portion of our new clients come from referrals from our existing clients. Our professional team of developers, marketers and support staff have invested the best knowledge and experience in the field into our work, so you know you can come back to us again and again.
One year free and high quality support. We go to great lengths to provide maximum satisfaction with every module you have purchased in our store. By helping you with installation, configuration, answering your every question, we do all our best to eliminate any possible problems.
30-days money back guarantee. If you are not satisfied with our extension performance for any reason, we provide a full refund.
We constantly add new features to all our modules, and are always interested in hearing your opinion and implementing your suggested features in our future developments.
We provide an expanded user guide for every aspect of our extension, so you can find answers for all your burning questions.
You can customize extension according to your needs and requirements.
The Module is easy to install and upgrade, just follow our step-by-step user guide. Additionally, the extension is ready to use with the Hyvä theme.
No core modifications. The extension has been tested in a Magento Cloud environment and is fully compatible with it.
Andriy Kovalenko