Zen Cart Logo
Forums / General Questions / Code to show all categories on a particular category page?

Code to show all categories on a particular category page?

Locked

Views: 1,094

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
13 Jun 2010, 4:32 AM
#1
davemehta avatar

davemehta

Zen Follower

Join Date:
Aug 2005
Posts:
130
Plugin Contributions:
0

Code to show all categories on a particular category page?

We have a category that has a few sub-categories in it and of course when you load the page you see the sub-category images and can then click them to go into the sub-categories.

What I want to do is list all the other top-level categories and show the icons much like when you call /index.php?main_page=index&cPath=0.

A picture tells the story of what I want to do a little easier so i've attached an example image.

Now, I see that in the includes/modules/category_row.php file that the $categories variable lists the sub-categories right there. But problem... I can't define it to give me all the top-level categories. So I found the zen_get_categories() function. But it doesn't return the image for the category so I can't use that to build the full category list like I want. How can I find out the image links so I can show them and make it look like my example mock-up? Oh, and just to note I am using the ImageHandler2 mod so I'd need to find the url of the image that it resized (in the bmz_cache folder).

13 Jun 2010, 6:59 PM
#2
davemehta avatar

davemehta

Zen Follower

Join Date:
Aug 2005
Posts:
130
Plugin Contributions:
0

Re: Code to show all categories on a particular category page?

Ok, so I've scoured all the Zen functions at http://phpxref.com/xref/zencart/_functions/index.html and can't find a solution. I would think this would be pretty simple but it's proving not to be! Any 'guru-level' help would be much appreciated :-)

20 Jun 2010, 8:49 PM
#3
davemehta avatar

davemehta

Zen Follower

Join Date:
Aug 2005
Posts:
130
Plugin Contributions:
0

Re: Code to show all categories on a particular category page?

No one can help? Thought this was pretty easy... I already have the function to get the list of main categories... all I need to know is how to show the category's picture based on having the cat id... if I knew that I could recreate it.

5 Jul 2010, 6:45 PM
#4
davemehta avatar

davemehta

Zen Follower

Join Date:
Aug 2005
Posts:
130
Plugin Contributions:
0

Re: Code to show all categories on a particular category page?

I still haven't found a solution -- DrByte, Ajeh, or any of you other gurus, could you point me in the right direction of what function to use to pull the category picture if I have a category id?

Be sure to check out the sample image of what I am trying to do, that I attached in my first post. It provides a better idea of what I want to accomplish.

Thanks!