I've rewritten the code for the enhanced categories box to be more efficient. As originally written with the added dropdown the categories were being loaded from the database twice. In addition, the osCommerce category product count function is inefficient when categories are deeply nested since the nested categories being shown are counted multiple times, once for each level down.
With this version all category information needed is retrieved from the database once. If counts are shown each category is counted once in the database and then the counts for nested categories are added to their parent category's counts without further database access being necessary. This should decrease the page load time on large sites with a lot of nested categories and a lot of products.
Visually the only change is that when counts are displayed the count of specials is also shown, zero counts are now displayed, and the category counts also appear in the category drop down.
Complete install with all previous language instruction files is attached. Just replace the boxes/categories.php if you already have an earlier version installed.
More...





LinkBack URL
About LinkBacks









Bookmarks