Sorting categories by product availability
Translated using on Google Translate

Improvement-script “Sort categories by product availability” is designed to improve usability and display information for the convenience of the buyer in an online store based on CS-Cart.
Script to change the sorting of categories depending on whether there are goods in them or not, which can be hung on the cron command. If an active product appears in the section, the category will change sorting from position 500 to 0 and line up back alphabetically.
A new field for the category table has been added, where the number of active products in the category is written (it can be displayed anywhere - see screenshots 2, 3 for an example). These numbers are counted together with the change of the order of subcategories by the cron command (all sections except the first level of nesting of the category).
Images


