Zen Follower
- Join Date:
- Jun 2006
- Posts:
- 123
- Plugin Contributions:
- 0
Coding advice... show Subcategories' products when browsing main category?
Hi,
I've been trying to figure this one out..... When a category has no products, only sub-categories, we want our web store to display all the products from the sub-categories - on the main category page.
(This way, the sub-categories can act as "filters" - when browsing the main category, the customer will see all the products from the sub-categories, and can click on each sub-category to filter the results).
I know the key is probably in the SQL query.... I know some PHP and have successfully done a bit of custom modding with it already, but alas, I'm in the dark when it comes to SQL.... :blink:
(By the way, I'm using Zen Cart 1.3.0.1 with the "column grid display" mod)
I thought of taking a cue from the SQL query in the "New Products" display routine, since it shows (random) new products from all the subcategories under the current top-level category, but this is not exactly what I want (I want it to show all products from the current-level category downwards)..... and besides I'm not exactly sure how to refit it for the main category browsing code....
So, hopefully someone more familiar with SQL and the Zen Cart code could help me... would be massively appreciated! :thumbsup: