Welcome to the Improved Sorting documentation. Whether you are new or an advanced user, you can find some useful information here.
First of all, we recommend that you check the following link:
php -f bin/magento module:enable Mirasvit_Core Mirasvit_Sorting
to enable the extension.php -f bin/magento setup:upgrade
to install the extension.php -f bin/magento cache:clean
to clean the cache.Deploy static view files
rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy
Ranking Factor is an internal functionality that is used to define the logic for scoring products in sorting criteria.
You can find existing ranking factors or create new ones under System > Improved Sorting > Ranking Factors.
Global factors have the highest priority.
The extension sorts any product collection firstly by global factors, and then it sorts products by sorting criteria.
This ranking factor sorts products based on alphanumeric (natural) sort order. This type of sorting orders alphanumeric strings as a human would, taking into account both letters and numbers.
For example, if you have product names that include numbers, such as "Z1.1", "Z2", and "Z11", alphanumeric sort order would sort them in the following order: "Z1.1", "Z2", "Z11", instead of the standard sort order of "Z11", "Z1.1", "Z2".
Ranks products based on Created At/Updated At date;
Created At/Updated At
date influences the products ranking.
Ranks products based on an attribute set.
Rank products based on the availability of images.
It commonly used as a global factor to place products without images at the end of the product list.
This ranking factor ranks products based on their overall rating, with the highest rating receiving the highest rank.
It is commonly used for sorting criteria such as 'Sort by Rating' or as part of the 'Featured' sorting criteria.
This ranking factor ranks products based on the number of purchases within a given period of time, where:
This ranking factor ranks products based on their profit, calculated using the product's price and cost.
The higher the profit margin, the higher the product's rank.
This ranking factor ranks products based on various conditions that you can define using rules, including Product Attributes
.
This ranking factor ranks products based on their stock status, whether they are in stock or out of stock.
It is commonly used as a global ranking factor to move out-of-stock products to the end of the product listing.
This ranking factor ranks products based on their stock quantity. Products with higher stock quantities will receive a higher ranking.
This factor can be useful for highlighting popular or high-selling products that are in stock and readily available to customers. Additionally, it can help to ensure that customers are shown products that are more likely to be in stock, which can improve their overall shopping experience.
The Sales Pre-View ranking factor sorts products based on the ratio of sales to page (product page) views. This factor takes into account not only the number of sales but also the number of times a product has been viewed, where:
Number of Sales
/ Number of Product Page Views
This can be a useful metric for identifying products that generate a high level of interest among customers and have a good conversion rate.
This ranking factor ranks products based on the number of product page views.
This factor can be useful for identifying products that generate a lot of interest or attract a high level of traffic to your store.
This ranking factor ranks products by discount, calculated as the difference between the regular price and any special prices.
This factor can be useful for highlighting products with significant discounts and encouraging customers to make a purchase. By sorting products based on this factor, you can also help customers find products that offer the best value for their money
This ranking factor ranks products based on their new from-to values, depending on the current date. Products with a more recent from-to value will receive a higher ranking in the search results for this factor.
This ranking factor ranks products based on their backorder status, whether it's allowed or not allowed.
This ranking factor ranks products based on a user-defined formula. You can customize the formula to take into account various product attributes such as price, rating, and stock quantity, as well as other factors such as shipping time and location.
Using this factor, you can create a custom ranking system that aligns with your business goals and customer preferences. More details here
The factor of the type formula calculates the sorting score based on the formula.
The syntax of the formula is the same as the syntax of spreadsheet formulas.
The formula should return a numeric result. Non-numeric results will be considered as NULL.
The formula SHOULD always start with =
.
{product_[attribute_code]} - product attributes variable like {product_price}, {product_color}. Attributes of types gallery and media_image are not allowed in the formula.
Most common product attributes' variables:
={product_cost} / {product_weight}
- simple formula. This formula calculates the unit cost for each product.=IF({product_cost} > 50, 100, 0)
- formula with the condition.=IF({product_brand} = "Adidas", 100, 0)
- formula with the attribute of the type select.=IF(ISNUMBER(FIND("Gym", {product_activity})), 10, 1)
- formula with the attribute of the type multiselect.
ISNUMBER(FIND([needle], [variable]))
.FIND([needle], [variable])
is responsible for searching needle in the variable's value.
If the needle is not found the FIND()
function returns #VALUE! which makes the IF()
function return the same.FIND()
function should be wrapped in ISNUMBER()
function.
In this case, the whole formula will return correct results.
Go to System > Improved Sorting > Sorting Criteria.
You will see the list of configured sorting options. If the list is empty, Magento will use the default sorting options.
Here you can change the order of the criteria visible to users and add/remove available options.
Once you add your first sorting criteria, the extension will replace native Magento sorting options and use your configuration.
To add new Criteria click Add new button.
Used for Sorting in Product Listing
is enabled (Stores > Attributes > Product);Add New Sub Condition button - allows for adding several criteria and setting their weight in the current group of conditions. Affects the position of a product in a category.
The extension will calculate, assign each item its own Score, and place them in ascending or descending order. For example, let's apply sorting by creation date and stock availability:
Add New Condition button - allows for setting the sort sequence; affects the product position in the product group and in the category;
It will sequentially sort the products, first by the first condition and then by the subsequent conditions within the group. Lets arrange the products, for example, by creation date and then by stock availability for the specified date:
The extension allows you to manage the sorting in Default Magento Widgets.
To check the product position in the backend, use the Preview button when creating a Ranking Factor or Sorting Criteria.
To check the product position in the frontend, use ?debug=sorting
in the page URL. This allows you to see the score for each product.
Usage: php -f bin/magento [options]
mirasvit:sorting:reindex
- reindex extension indexes as you would for the native Magento 2 command: indexer:reindex mst_sorting
The extension uses the same logic for translations as default Magento. More details: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/translations/xlate.html)
Our i18n files should be located at: vendor/mirasvit/module-sorting/src/Sorting/i18n/
Create a separate file for your language (en_US.csv, de_DE.csv). The names for all languages can be found via this command:
php -f bin/magento info:language:list
Override the strings in your dictionary file:
"Original line" , "Translated line"
Run this command to see the changes:
php -f bin/magento setup:static-content:deploy
php -f bin/magento cache:flush
The custom themes will be displayed instead of the default for your language.
You can use different sorting criteria for different categories. To do this, go to Catalog > Categories > YourCategoryName > Display Settings > Available Product Listing Sort By and set the required sorting criteria for this category.
Also, you can set default sorting for this category. Please use the Default Product Listing Sort By option.
To upgrade the extension, take the following steps:
composer require mirasvit/module-sorting:* --update-with-dependencies
to update the current extension with all dependencies.
composer update mirasvit/*
command. It will update all Mirasvit modules installed on your store. php -f bin/magento setup:upgrade
to install updates.php -f bin/magento cache:clean
to clean the cache.Deploy static view files
rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy
To temporarily disable the extension, please take the following steps:
php -f bin/magento module:disable Mirasvit_Sorting
to disable the extension.To uninstall the extension please take the following steps:
composer remove mirasvit/module-sorting
to remove the extension.(2024-11-04)
(2024-10-25)
(2024-06-26)
(2024-06-10)
(2024-05-24)
(2024-05-07)
(2024-04-22)
(2024-02-26)
(2023-10-19)
(2023-10-18)
(2023-10-17)
(2023-10-10)
(2023-07-25)
(2023-07-20)
(2023-07-05)
(2023-06-22)
(2023-06-12)
(2023-05-30)
(2023-05-29)
(2023-04-27)
(2023-04-24)
(2023-04-20)
(2023-04-05)
(2023-03-31)
(2023-03-15)
(2023-01-10)
(2022-12-29)
(2022-12-26)
(2022-10-20)
(2022-09-29)
(2022-09-07)
(2022-09-02)
(2022-09-01)
(2022-08-26)
(2022-08-18)
(2022-08-15)
(2022-08-05)
(2022-08-02)
(2022-07-20)
(2022-06-20)
(2022-06-16)
(2022-06-07)
(2022-05-27)
(2022-05-26)
(2022-05-24)
(2022-05-18)
(2022-04-28)
(2022-04-21)
(2022-03-30)
(2022-03-29)
(2022-03-17)
(2022-03-10)
(2022-02-18)
(2022-01-04)
(2021-11-23)
(2021-10-29)
(2021-09-20)
(2021-08-13)
(2021-08-13)
(2021-08-06)
(2021-07-20)
(2021-05-26)
(2021-04-14)
(2021-04-05)
(2021-04-01)
(2021-03-04)
(2021-01-27)
(2020-12-30)
(2020-12-22)
(2020-12-07)
(2020-12-04)
(2020-11-27)
(2020-11-24)
(2020-11-23)
(2020-10-12)
(2020-10-08)
(2020-09-23)
(2020-09-09)
(2020-08-19)
(2020-08-11)
(2020-07-29)
(2020-06-30)
(2020-05-15)
(2020-04-14)
(2020-03-27)
(2020-03-26)
(2020-03-23)
(2020-03-16)
(2020-02-28)
(2020-02-27)
(2020-02-21)
(2020-02-12)
(2020-02-06)
(2019-12-30)
(2019-11-25)
(2019-11-21)
(2019-11-07)
(2019-10-10)
(2019-09-02)
(2019-07-25)
(2019-05-20)
(2019-05-16)
(2019-04-17)
(2019-04-10)
(2019-04-08)
(2019-04-01)
(2019-03-27)
(2019-03-19)
(2019-03-18)
(2019-03-11)
(2019-03-07)
(2019-03-04)
(2019-02-22)
(2019-02-11)
(2019-01-10)
(2019-01-09)
(2019-01-08)
(2018-12-27)
(2018-12-11)
(2018-12-07)
(2018-12-06)
(2018-12-06)
(2018-12-05)