Magento 2 Improved Sorting Extension

View Demo

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
Marketplace Approved
Hyvä
Magento Cloud
GraphQL
WCAG
Mage-OS
Compatible with:
Community:
2.3.* - 2.4.9
Enterprise:
2.3.* - 2.4.9

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 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

Product Spotlight

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.

Pin to Top

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.

Better Sorting Options

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.

Higher Conversion Rate

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.

Date

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.

Attribute

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.

Image

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.

Product Rating

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.

Bestsellers

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.

Profit

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.

Rule

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.

Availability

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.

Popularity

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.

Sales per View

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.

Discounts

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.

Custom Formula

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.

Combine the Rules

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.

Combining several variables to form a single sorting criterion in Mirasvit Magento 2 Improved Sorting extension
Fine-tune the Score Calculation

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.

Set the Default 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.

Custom default sorting criterion in Mirasvit Magento 2 Improved Sorting module.

Advanced Magento Product Sorting Features

Search Results Integration

Teach your search how to sell

Using custom sorting criteria within site search in Mirasvit Magento 2 Improved Sorting module.

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.

Widget Integration

Improve the widgets' efficiency as well

A product widget with a custom sorting rule in Mirasvit Magento 2 Improved Sorting extension.

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.

Product Preview

Double-check any setup easily

Sorting Criterion preview in Mirasvit Magento 2 Improved Sorting extension.

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.

Debugging

Streamline problem-solving

Frontend debug mode in Mirasvit Magento 2 Improved Sorting module.

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
Arrange the products according to what you need, not what you have. Get Improved Sorting!
Comparison
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
No hidden fees
Our developers install the extension on your store and configure it for your setup, free of charge.
Lifetime access to source code
Access to free support and updates for 1 year
Updates and support prolongation - $90

Pay today $149 for the first year.

Then $90 for updates and support services per year.

Cancel anytime.

30 days money back guarantee
See it in action!
Pick a quick tutorial to learn about various aspects of this extension
Customer Reviews 43
Earn points for your review about this extension modules. $1 = 10 points
Write Your Own Review

check-circle You submitted your review for moderation.

hakan Verified Buyer
From Istanbul, Turkey
Using the module for over 2 years
Good
Indexing is heavy but extension is nice.
Also installed:
Follow Up Email,  Automatic Related Products,  Layered Navigation,  Order Management,  Extended Shopping Cart Rules,  Facebook Pixel & Conversion API
Alex Verified Buyer
From United States
Using the module for over 1 month
Improved sorting shows promise
This is a solid extension with a lot of potential, though I expected better performance when working with configurable products.
Lukasz Verified Buyer
From Gdańsk, Poland
Using the module for over 1 year
Probably the best sorting extension on the market.
Easy to configuration, works great.
Also installed:
Blog MX,  Advanced SEO Suite,  Mass Product Actions,  Order Management,  Admin Bookmarks,  Product Labels,  GDPR and 16 more
Javier Verified Buyer
From Málaga, Spain
Using the module for over 2 years
Margen de mejora
He probado otros módulos para mejorar la ordenación y aunque este parece superior algunos cálculos como las ventas de los productos no consigo que se comporte ncomo me esperaría, aunque el modo debug ayuda
Also installed:
Elastic Search Ultimate,  Advanced SEO Suite,  Google PageSpeed Optimizer,  Full Page Cache Warmer,  Google Tag Manager,  Advanced Reviews,  Layered Navigation and 9 more
Angelo Verified Buyer
From Messina, Italy
Using the module for over 1 year
Installation went smoothly and worked great
It extends the sorting functionality of category pages very well with different degrees of freedom
Also installed:
Reward Points
Manual & Support
Need more help?

Save time by starting your support request online and we'll connect you to an expert.

Frequently asked questions
chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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.

chevron-down chevron-right

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".

chevron-down chevron-right

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".

chevron-down chevron-right

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.

chevron-down chevron-right

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.

Changelog
Version 1.5.0Oct 8, 2026
Show a sorting criterion only in selected categories — the criterion form has a new "Show in categories" switch: keep the default "All categories", or choose "Selected categories" and tick categories in a tree. A restricted criterion appears in the "Sort by" dropdown only on the ticked category pages (subcategories are not included automatically). The category's own "Available Product Listing Sort By" setting still narrows the list on top; if that leaves nothing, every visible criterion is offered. The default sort order and ?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 languages
GraphQL follows the same category rules — sort_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 page
⚠️ Database changes — new column mst_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 one
Stock-based sorting now updates when MSI changes a product's salability — when Multi-Source Inventory recalculated whether a product is salable (for example after an order or reservation), the Stock, Stock Qty, Backorder and Child In Stock ranking factors kept the old in-stock/out-of-stock score until the next full reindex, so sold-out products could stay on top. Now only the affected products and only the stock-dependent factors are re-scored, and a failure in this step is logged instead of blocking Magento's own stock cache refresh
Saving a customer or order no longer fails on Magento 2.4.9 when an old order contains a deleted product — with indexers on "Update by Schedule", Magento 2.4.9 rejected the sorting change-log entry for order items whose product had been deleted, rolling back the whole save (e.g. changing a customer's email) with a "Column 'entity_id' cannot be null" error. The fix also holds when other extensions (such as Adobe Commerce's data exporter) or setup:upgrade rebuild the shared database trigger
Each rule-based ranking factor now scores only its own matches — when several "Rule" ranking factors were reindexed in one run, products matched by an earlier rule were also scored as matches by the following rules, so later rules boosted the wrong products
Catalog Products widgets sorted by a criterion now respect it on Elasticsuite — on stores using Smile Elasticsuite, a widget with a sorting criterion in its "Sort by" setting showed products in the search engine's default order
Category selections on a criterion are kept when an Adobe Commerce scheduled update is removed — removing a staging version of a category no longer drops that category from criteria restricted to it. Links are cleaned up only when a category (including a whole subtree) is actually deleted
GraphQL sort_fields no longer fails with an error when no default sorting criterion is configured
Limited the PhpSpreadsheet library (used by the Formula ranking factor) to versions below 6.0, so Composer cannot install an untested major or development release that could break the store
Version 1.4.18Sep 18, 2026
Category pages are no longer flushed from cache on every scheduled reindex — the sorting index rebuild runs on a cron up to four times a day and used to wipe the full-page cache for the entire category tree on each run, even when nothing you control had changed. The cache is now cleared when you actually save a ranking factor or sorting criterion; a purely periodic rebuild refreshes it at most once a day. Category pages stay fast and server load during the day drops noticeably
The admin reminder shown after saving a sorting criterion or reindexing a ranking factor now says "Elasticsearch/OpenSearch engine is used" instead of naming Elasticsearch only — stores running OpenSearch were being told about an engine they do not use. Updated in all 16 shipped languages
⚠️ For developers with custom ranking factors — the store ID is now a required argument when a ranking factor writes its scores to the sorting index. A custom factor that omits it will fail loudly on reindex instead of silently writing scores that only apply at global scope. Pass 0 explicitly if the factor's data really is the same for every store view
Sorting now works on stores using the Smile ElasticSuite search engine — the engine was not recognized as Elasticsearch-compatible, which could prevent your criteria and ranking factors from being applied to category, search, and search API (REST/GraphQL) results
⚠️ Criterion conditions and ranking factor settings saved in the legacy format are converted automatically — on stores upgraded from very old Magento versions, these settings were stored in an outdated format that could no longer be read, so a criterion could load with no conditions and a ranking factor with no configuration. A one-time migration converts them during setup:upgrade; rows already in the current format are skipped, so it is safe to run repeatedly
Search Suggest now respects your "Default for Search" criterion — with Search Autocomplete Fast Mode ON, the suggestion dropdown ignored the criterion configured as the default for search and could show old or out-of-stock products first. It now sorts suggestions by your configured default. Stores that have not set a default for search are unaffected
The "Default for Search" criterion is also applied with Fast Mode OFF — on Elasticsearch/OpenSearch the suggestion dropdown fell back to plain relevance, so the criterion saved without ever taking effect. It is now used as the default order, keeping every step of a multi-step criterion. A criterion that mixes ranking factors with product attributes safely falls back to relevance instead of making the search engine reject the request and return no suggestions at all
Date-based sorting now works on every store view — the Date ranking factor (created/updated date) wrote its scores only at global scope, leaving individual store views with no score, and it ignored per-store-view "News From Date" overrides. Scores are now written for each active store view, and store-level overrides are honored
"Is New" sorting now works on every store view — like the Date factor, the Is New ranking factor scored products at global scope only, so a criterion based on it had no visible effect on any real store view. It now honors each product's store-specific "Set Product as New from Date" value
Products stop being treated as new once "Set Product as New to Date" passes — the end date was never applied, so a product that had been marked new kept receiving the maximum "Is New" score indefinitely and stayed at the top of new-first listings. The newness period now ends on the configured date
Ranking factor reindex no longer hides real errors — genuine database errors during reindex could be misread as routine lock conflicts and quietly ignored, leaving a ranking factor unscored with nothing in the logs to explain it, and in some cases an unfinished database transaction was left open and produced a confusing secondary error. Lock conflicts are still retried silently as before; every other failure is now reported
Version 1.4.17Sep 2, 2026
Relevance-sorted search results now follow the search engine's relevance score instead of being overridden by other ranking factors
Fixed product sorting that could show the wrong order on some store views
Fixed an error that could break product pages and search on stores using certain Elasticsearch integrations
Sorting debug information is no longer shown on the storefront by default
Sorting index cleanup no longer stalls on stores with very large catalogs
Version 1.4.16Aug 25, 2026
Fixed sorting on stores using the Amasty Elastic OpenSearch search engine — sorting options were not recognized as compatible with this engine, which could prevent them from being applied correctly on category, search, and search API (REST/GraphQL) results
Version 1.4.15Aug 18, 2026
Sped up category pages that combine "Pin to Top" with layered navigation by removing redundant, repeated database lookups for pinned products on the same page render
Fixed intermittent 500 errors on storefront and CMS pages during catalog reindex — on MariaDB, any page that touched ranking factors could crash with a database error if it was loaded while a reindex was in progress, because the sorting index's internal columns were being read at the same moment they were being modified. These pages now keep working correctly throughout a reindex.
Reasons to choose Mirasvit
Client focusing and satisfaction

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.

Remarkable support

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.

Risk-free Investment

30-days money back guarantee. If you are not satisfied with our extension performance for any reason, we provide a full refund.

Constant improvements and upgrades

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.

Comprehensive Documentation

We provide an expanded user guide for every aspect of our extension, so you can find answers for all your burning questions.

Unencrypted source code of our products

You can customize extension according to your needs and requirements.

Usability and Performance

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.

Ready for Magento Cloud

No core modifications. The extension has been tested in a Magento Cloud environment and is fully compatible with it.

Loading...