Module Sort products in-stock first
for PrestaShop 1.5, 1.6, 1.7
Questions?
Description
Short Description
Moves unavailable (out-of-stock) products to the end of product lists regardless of sorting. The module works on various pages and blocks where a list of products is displayed.
Benefits for the e-merchant
Automation of manual labor.
No need to disable a product when it is not available (out of stock), and then to enable when it become available for an order. With this module, manual labor is completely excluded, as moving products to the end of any list is done automatically!
Website promotion and SEO.
The module will allow you to leave products visible for search bots and users until products temporarily unavailable or will no longer available (end of life). This is a good practice, since product pages stay available in a search index of search engines and therefore saves free user traffic from a search. In addition, you could get potential user activity, for example, commenting on products by users on your site or linking to these pages from another site, which may attract new potential customers.
Benefits for the customer
A customer sees always available products for sale in the first place and thereby save his time and nerves to find needed product. The module is especially useful when a store has much products, many of which are often unavailable (out-of-stock). Thus, the module helps build customer loyalty.
Features
The main feature is moving unavailable (out-of-stock) products to the end of product lists regardless of sorting: product pages and blocks.
It is important to note that, this module do not change data in a database of a shop. The module just moving products to the end of a list on runtime.
Product availability can be determined in two ways:
- Checking a stock quantity of a product, which is greater than zero.
- Checking "Available for order" option of the product instead of checking of its a stock quantity of a product (the setting is useful, because sometimes selling of products are performing without taking into account of stock quantities).
This feature works for example, in pages:
- categories
- search (including a list of instant results by Ajax)
- manufacturers
- suppliers
- new products
- bestsellers
- prices drop
- and other pages and blocks
With any sorting option, a customer will always see products available for an order, and at the very end of the list, a customer will see products which are unavailable (out-of-stock, end-of-life and etc).
Special cache.
The module has an additional special cache for 4 hours for storing ready-made data of stock quantities, which allows the module to work very quickly. In some cases, the site will work even faster with this module than before.
Integration with other modules.
- The module works correctly together with various modules that use PrestaShop core to get a list of products, for example: «Top-sellers block», «New products block», «Featured products on the homepage» and many others.
- But the module is not works «from the box» with such complex filtering modules as «Layered navigation block», «Faceted search», «Advanced Search 4» and others. These modules use their own methods for obtaining a list of products, instead of PrestaShop methods. To make such modules work together, there is a solution, but it requires changing the code of these modules. Unfortunately, it is not possible to make this integration without changing the code of other modules.
- Together with the user manual, you will get ready-made modified files for integrating «Sort products in-stock first» module with various versions of popular modules: «Faceted search», «Advanced Search 4». The user manual provides instructions for integrating with any other module.
Other benefits of using the module.
The additional feature is to sort products with combinations properly when a base price of a product is zero. You can check your PrestaShop and you will see this problem.
The "Sort by stock quantity" option on the product listing pages is no longer needed.
Installation
The module has a normal installation and uses PrestaShop class override system to override default behavior. Installation of the module is described in the manual.
Demonstration
Website demo for PrestaShop 1.7
How to check the module on the demo web-shop?
1. Follow the demonstration page. The page contains three products in the end of the product list:
- The cup 1 w/o remains
- The cup 2 w/o remains
- The cup 3 w/o remains
2. Change the sorting option and make sure that products are still in the end of this list.
Data sheet
- Compatible with versions of PrestaShop: 1.5, 1.6, 1.7
- Compatible with versions of PHP: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4
- PHP options "auto_prepend_file" and "auto_append_file": must be disabled
- Requires ionCube extension for PHP: 10.3.9 or newer
- Installation: normal
- Uses PrestaShop classes override system: yes
- Core modifications: no
- Includes a documentation: yes
- Includes free consultations: no
- Translated into languages: EN, RU
- Version: 1.17.0 (2022-08-05)
- License: Proprietary license for closed-source software
- Product type: Module
v0.8.0 (2014-05-05) + the first release for PrestaShop 1.5 - 1.6 v0.8.1 (2014-10-20) + fixed a problem that appeared when a catalog of products contains one or more products with ID equal zero. v0.9 (2014-11-05) + added new price sorting feature that allows to sort products with combinations properly when a base price of a product is zero v1.0 (2015-02-22) + sorting algorithm is improved + some code improvements v1.0.1 (2016-02-14) + improved compatibility with PrestaShop 1.6 + removed a property that restricts the module installation on PrestaShop versions out of the predefined range v1.0.2 (2016-11-18) + removing classes cache file (class_index.php) after module has installed v1.1.0 (2018-08-18) + added support PrestaShop 1.7 + removed support PrestaShop 1.5 v1.3.0 (2019-04-13) + the algorithm to get a product remains was improved taking in to account warehouses + the fast algorithm to get products remains was developed (additional special cache enabled for 4 hours: acceleration up to several dozen times with several thousand products) v1.5.0 (2019-06-28) + added a button to reset the cache in the module settings (as well, the cache will be cleared when you click "Clear cache" in the "Performance" page) + the algorithm to get a product remains was improved taking in to account each combination of a product v1.6.0 (2020-02-18) + added a setting to check whether the product option is "Available for sale", instead of checking stock quantities (the setting is useful, because sometimes selling of products are performing without taking into account of stock quantities) v1.8.0 (2020-05-06) + added support for older versions of PrestaShop 1.6 (below to 1.6.1.0) and again added support for versions of PrestaShop 1.5 (previously it excluded in the module version of 1.1.0) + caching of SQL queries for products in a category and in a supplier’s page was done (on these pages in PrestaShop they are not initially cached in any version) + in getProductsLite methods of overridden classes was added available_for_order column to a SQL query, which was absent (it is needed for the "Available for sale" option to work) + applied small new changes made in PrestaShop 1.7 to the overridden Search class v1.8.1 (2020-06-12) + fixed saving of an actual cache (saving was always done, even if the array of stock quantities was not changed) v1.9.0 (2020-07-18) + a library component of caching is involved, instead of its own implementation v1.11.0 (2020-09-10) + an improvement has been made so products without stock, but with the option "Allow orders", are moved to the end of a list, but before products that are without stock and with the option "Deny orders" + added a check for a presence of modules with which integration is required and a notice is made with a corresponding information + slightly changed the structure of the module and simplified the inclusion of the class autoloader v1.12.0 (2020-11-06) + added the integration with "Amazzing filter" module in overridden classes v1.14.0 (2020-12-14) + added support for all modes of processing a stock quantity of a pack (before that, packs were moved in the list correctly only in the case of the default setting when the stock quantity was setup directly for a pack) + added support for processing an input data array in the form of ProductLazyArray (modern modules are uses it) + improved saving of stock quantities to the cache, taking into account a current shop identifier (along with this, multishop feature support is now complete) + returned a product list limit for an Ajax request equal to ten v1.15.0 (2021-05-28) + improvement of the algorithm for working with packs of products + fixed index check in an array with product data (led to an error when working with some listing modules) + added a tooltip for an option in the modules settings v1.16.0 (2021-09-01) + updated dependencies and a client code v1.17.0 (2022-08-05) + added movement of products in a list of accessories + updated dependencies
Great module and very good support! I recommend this module without any hesitation!
--
bureau-vallee.es