Magento 2 Module – Product Sorting by Popularity
- SKU
- M2-POPULARITY
Description / Magento 2 Module – Product Sorting by Popularity
MAGENTO 2 · MERCHANDISING · SALES · SORTING
Showcase bestsellers based on sales data.
Kowal Popularity
Calculate product popularity for a selected period and order statuses. Add your own promotion priority, then use the result to sort your offer and PageBuilder product lists.
Sales data · Manual priority · Logs and CRON
HOW IT WORKS IN PRACTICE
01 · Define the analysis scope
Select the number of days, statuses, and ignored store views.
02 · Recalculate popularity
CRON or a manual run updates the attributes.
03 · Sort the presentation
Select popularity for the product list.
What does your store gain?
Explore the module features, use cases, and settings.
Get to know the module
Want to increase sales in your Magento store? The Product Sorting by Popularity module is a solution that lets you automatically display best-selling products in top positions, increasing their visibility and sales.
How does the module work?
The module installs two new product attributes:
- Popularity – calculates popularity based on real sales data from the time range you specify.
- Custom Popularity – allows you to manually set an artificial popularity value for selected products to promote specific items even more effectively.
Popularity calculations are performed automatically via the task scheduler (cron) every day at 5:00 AM (0 5 * * *). In addition, the module offers the option to manually run calculations from the Magento admin panel, where you can view results on an ongoing basis in clear logs.
Key module features
- Enable and disable the module – easily manage sorting availability.
- Set the calculation period – define how many days of sales data should be analyzed.
- Select order statuses – the analysis will include only orders with the statuses you select, allowing precise adjustment to your store needs.
- Exclude store views – exclude specific store views from the popularity analysis so they do not distort the results.
- Log preview – easy access to product popularity calculation results in the admin panel.
Benefits of using the module in a Magento store
- Greater visibility for bestsellers – sorting can support sales and conversion; the result depends on the offer and implementation.
- Merchandising automation – save time thanks to automatic sales analysis and product sorting.
- Promotion of selected products – manually increase popularity using the custom_popularity attribute.
- Flexible configuration – full control over the data analyzed by the module.
- Transparency and control – access to logs lets you continuously monitor the effectiveness of popularity calculations.
The marketing importance of presenting products effectively
Properly presenting your product offer is a key element of success for any online store. Customers most often make a purchase decision based on what they see first. Showcasing bestsellers and products with the highest interest has a positive impact on conversion and builds a positive store image. With automatic sorting by popularity, you can execute your marketing strategy more effectively, which translates into higher sales and greater customer satisfaction.
Who is this module for?
The Product Sorting by Popularity module is a good fit for any Magento store that wants to increase sales and effectively promote bestsellers. With it, you can easily increase the visibility of the most in-demand products.
SEO and Magento store optimization
Sorting by popularity can make it easier for customers to find products and support the user experience. It is an element of offer presentation; it does not guarantee an increase in organic traffic or search engine rankings.
Summary
The Product Sorting by Popularity module is an effective and simple tool that will improve the sales efficiency of your Magento store. Start showcasing your bestsellers today and watch your sales results grow.
How is the popularity score created?
The module sums the qty_ordered quantity by SKU for selected order statuses and date range. It includes items without parent_item_id, skips the indicated store views, and adds a positive custom_popularity value. It is not a page view counter or website traffic analysis.
The implementation includes additional handling for configurable and bundle product relationships. The score is saved to the popularity attribute, and the process is saved to var/log/popularity.log. The package requires kowal/module-attributesquery.
PageBuilder list sorting and schedule
PageBuilder receives the Popularity (descending) and Popularity + Product Type options. The second option first sets priority for configurable, grouped, bundle, and other product types, then sorts by popularity in descending order.
CRON in the popularity group has the 0 5 * * * schedule; the execution time depends on the environment configuration. Calculating the attribute alone does not enforce this order in every store list: the appropriate sorting must be set. The sales effect also depends on the offer and presentation.
Installation via Composer
Package kowal/module-popularity, module Kowal_Popularity. After configuring access to the Kowal repository, install the package, enable the module, update Magento, and clear the cache. In production, include compilation and static content deployment according to your store process.
From configuration to results
1. Define the analysis scope
Select the number of days, statuses, and ignored store views.
2. Recalculate popularity
CRON or a manual run updates the attributes.
3. Sort the presentation
Select popularity for the product list.
Sales and promotion priority in one score
A product has 20 ordered units in the analyzed period and a manual custom_popularity value of 10. The calculation receives a score of 30, which you can use for descending sorting.
Manual priority also lets you promote products with no previous sales.
Connect sales results with your promotion plan
Want to adapt the module to your store? Ask about implementing Kowal Popularity and discuss the configuration or required extensions.
More Information
| Theme compatibility | Luma / Blank, KOWAL |
|---|
Change Log
Version: 1.0.6
04/15/2025
Enhancement
Added the ability to sort products by the popularity attribute in the PageBuilder widget – Product List and Product List Slider. The new ‘Popularity (descending)’ option allows the most popular products to be displayed at the beginning of the list, according to the value of the popularity attribute.
Module Installation Instructions
Installation and configuration guide for the Product Sorting by Popularity module for Magento 2
1. Module installation via Composer
Follow the steps below to correctly install the module in your Magento 2 store:
Step 1: Add repositories to the Composer configuration
You will receive access credentials for the Composer repository (customer email address and license token) by email after purchase. They are also available in the customer panel after logging in at kowal.store. Replace TWOJ_EMAIL_KLIENTA with your account email address and TWOJ_TOKEN with the token you received. Run the commands in the Magento root directory.
composer config repositories.kowal composer https://repo.kowal.storeStep 2: Configure access to the Kowal Composer repository
composer config http-basic.repo.kowal.store 'TWOJ_EMAIL_KLIENTA' 'TWOJ_TOKEN'Step 3: Install the module with Composer
composer require kowal/module-popularityStep 4: Enable the module in Magento 2
php bin/magento module:enable Kowal_PopularityStep 5: Apply database updates
php bin/magento setup:upgradeStep 6: Clear the Magento cache
php bin/magento cache:flush2. Module configuration in the Magento admin panel
After installing the module, go to the Magento admin panel and follow these steps:
a) Module settings:
- Go to Stores → Configuration → Kowal → Popularity.
- Enable or disable the module using the 'Enable Module' field.
- Set the popularity analysis period (in days) in the 'Sales Analysis Period' field.
- Select the order statuses to be included in the popularity analysis.
- Select the store views to be excluded from popularity calculations.
- Save the configuration.
b) Setting sorting by the popularity attribute:
- Go to Stores → Configuration → Catalog → Catalog → Product Listing.
- In the 'Available Sort By' section, make sure the 'Popularity' attribute has been added.
- In the 'Product Listing Sort By' section, you can set 'Popularity' as the default product sorting method.
- Save the configuration.
After completing these steps, your Magento 2 store will automatically sort products by their popularity.