Alright, after digging deep into this with Kim, here's the deal...
Displaying categories, at any number of sublevels, does not behave like a "normal" page. Usually, pages have a template in includes/templates/TEMPLATE_NAME/templates and then you can override the stuff in includes/templates/TEMPLATE_NAME/common by creating a templates folder. So for most any other page, I would just tell you to follow instructions in the comments in the tpl_main_page.php header and be done with it...
- Governs the overall layout of an entire page
- Normally consisting of a header, left side column. center column. right side column and footer
- For customizing, this file can be copied to /templates/your_template_dir/pagename
- example: to override the privacy page
-
- make a directory /templates/my_template/privacy
-
- copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php
But like I said, category listings are not normal. They have a separate template, but act as if they are part of the index. Look closer at your example URL...
fomax.us/idglass/index.php?[B]main_page=index[/B]&cPath=90
There are several pages like this that share the index layout. This means that following the override described in the quote above would affect all these shared pages as well (because you'd create /templates/my_template/index/tpl_main_page.php).
If that's as far as the issue went, I could suggest a hackaround. However, you want to show sidebars down to an arbitrary level in the subcategory navigation. That means analyzing the cPath argument in the URL to determine how deep we are. To see what I'm talking about, look at the number after cPath= in these two URL's
- http://zc.f10w.com/index.php?main_page=index&cPath=33
- http://zc.f10w.com/index.php?main_page=index&cPath=33_34
- http://zc.f10w.com/index.php?main_page=index&cPath=33_34_40
The underscore separate's and determines the order of categories. Now our hack has to break that up and analyze how many levels down we're going in order to determine if the sidebar should show up or not. There's code elsewhere in Zen Cart that does this, so we are still in the realm of possibility.
So even at this point, we still have a working -- but very ugly -- hack. However every category must have the exact same number of category levels for this to work. Let's use your example navigation...
Shoe > Mens shoe > Size > Reebok company
It stopped one above the last category, or the third one down. Our hack must now count the levels and turn the sidebar on/off accordingly.
As soon as you introduce a product line with more/less categories, you now have to add even more logic to the hack to track which category we're looking at. The hack now has to ask, "Are we looking at category #33, #34, #105 (etc.)?"
Chances are I made your head spin, in which case I apologize. My head hurts just thinking about coding that out. And my experience as (a) a developer and (b) an admin for a very large ZC installation tells me you're just asking for trouble down the road.
My recommendation is to definitively choose to have sidebars on or off and do it everywhere. It makes your code cleaner, sure, but I say that from a usability perspective too. Users expect similar pages to maintain their layout as they navigate. Dropping a whole section at given level breaks the flow, they think "Wait, somethings different. What is it, what happened? I'm not where I should be..."
A long explanation to a short answer. Hope it helps.