Optimize categories box

for osCommerce Online Merchant v2.2

It is common knowledge that displaying the numbers of products in the categories box (Configuration -> My Store -> Show Category Counts = true) generates a large numbers of queries. This small contribution slashes the numbers of queries on the front page of the default installation of osCommerce from 83 to 43 (so about two per category, showing the number of products per category) by querying most of the information needed in two queries (total) and storing/retrieving the results in/from an object. It is also used to cut the number of queries for the categories box needed.

Files