Forums / Templates, Stylesheets, Page Layout / View all products in top level category?

View all products in top level category?

Locked

Views: 10,551

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
12 Nov 2006, 9:19 PM
#1
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

View all products in top level category?

I've been looking all day for the answer to this one. I know that, when you create a category in the admin area, you can either put products in the category folder or another sub category (with products in that folder) - but you can't do both.

So, I was wondering - right now, when you go to a top-level category, it shows the image for that main category, and beneath it, it shows the categories that fall under the main one. What I need, instead, is for the main category to list all the products when you go to the top-level page (not list the subcategories, but just show everything in that category), and you can use the sidebar links to navigate down into those categories is you want to narrow things down a bit.

I've searched and can't find anything on this. I shall continue to search and mess with things, but I was hoping someone could point me in the right direction on how to do this?

12 Nov 2006, 9:26 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,684
Plugin Contributions:
0

Re: View all products in top level category?

Why have the subcategories if you are not going to use them? The whole idea is to organize the products in a "tree".

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

12 Nov 2006, 9:38 PM
#3
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

Why have the subcategories if you are not going to use them? The whole idea is to organize the products in a "tree".

Not that I agree with it, but it's not my decision. That's what they want - and I need to figure out how to do it.

Anyone have any ideas? I'd appreciate it!

13 Nov 2006, 12:42 AM
#4
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

Hmm...okay, if I can't have them in the top level category - how about a way to have the page open up to the first sub category, instead of the top-level? In other words, when I have a category tree like this:

Pictures

  • Animals
  • Vegetables
  • Minerals

Is there a way to have the page automatically open to "Animals" rather than "Pictures"?

13 Nov 2006, 1:59 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: View all products in top level category?

Peek in the Configuration ... Layout Settings ...

Categories - Always Show on Main Page
Always Show Categories on Main Page
0= off
1= on
Default category can be set to Top Level or a Specific Top Level
Main Page - Opens with Category
0= Top Level Categories
Or enter the Category ID#
Note: Sub Categories can also be used Example: 3_10

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

13 Nov 2006, 1:56 PM
#6
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

Thanks Ajeh - but I've already tried that.

The problem is that my Main Page has a different layout than the inside pages. So when I change the category to open up with, it alters my index page layout to look just like the inside pages, and I can't have that.

Maybe I should have given more information (I hate it when I see ambiguous questions, and here I am serving one up - beat me with a wet noodle!)

The way the site is designed is that the index page has a header naviagtion at the top - very basic. Contains links to the home page, and a couple of E-Z Pages, as well as Log In, Shopping Cart and Checkout. This header nav is constant throughout the site.

On the idex page, we have two sections: the right side has a large image (it's a photographer's site) and the left side has some introductory text on what the site is about. Under this text are small image links that will draw you into the shopping area - each link represents a different category for products, so each link will lead you to a different section of products (as it should be).

My issue is, when someone clicks on the main category link on the index page (the only way to get into the products listing areas), it takes you to the page that shows you the category, and then lists the subcategories. So it takes an additional step to get right in there and look around - something the client does not want. They want someone to either 1) click on the main category link on the index page and be taken to the main category page which houses all images contained in that category (my initial question) - and narrow things down if they so choose by clicking on the subcategories; or 2) have the index page link take you directly to the top-level subcategory, if there is one.

For the record, once you get to the inside pages/shopping area, there is alreayd a list of categories and subcategories in a sid nav menu - so the "open up to the main category" is (my client's words) "redundant and annoying".

So making those alterations in the admin isn't doing what I need it to do - it would, except that it's doing it on the wrong page. I haven't been able to find a setting for the categories so that you can have the category itself open to the first subcategory (if there is one) rather than opening up to the main one and have it show the list of subs before you can move on.

Man, I hope that made sense. I'd show you - but I'm working off a localhost server right now - so if more clarification is needed (for anyone who may be able to help), let me know.

13 Nov 2006, 2:19 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: View all products in top level category?

Yeah...I need more clarification.... Your example is:

Pictures

  • Animals
  • Vegetables
  • Minerals
    Why not make your top levels
    Animals
    Vegetables
    Minerals
    And skip the Pictures as the top. It would seem from your description that this would then navigate one to the pictures(products) in animals, Vegtables, or Minerals...and you can place/insert a leading image as the category image for each. Like a tiger, tomato, and a rock.

Have you tried it this way and I am just not getting it?

Zen-Venom Get Bitten

13 Nov 2006, 9:07 PM
#8
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

Well - there's a DUH moment for you. A question about that, though: if I do that...is there a way I can define a title for them? Argh - it's so hard to describe. See, I need the word "Pictures" there - it doesn't necessarily need to link to anything, but it has to be there - with the subcategories. There are several groups of items she's selling, and I need them separated. So, keeping with the other example:

Pictures

  • Animals
  • Vegetables
  • Minerals

Books

  • Literature
  • Romance

So, if I did what you suggested, how would I also retain "Pictures" and "Books"? (Does that make more sense?)

So, your suggestion would work great for the index page, but I still need that tree in the sidebar of the inside pages that still has the main category(Pictures and Books) - the main ones don't have to link to anything - but if there were a way to retain some type of heading like that and implement your suggestion, I'd be home free.

13 Nov 2006, 11:17 PM
#9
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: View all products in top level category?

You could change the title of the sidebox header:

instead of categories call it Pictures

PICTURES (this would be the sidebox heading)
Inside would be the categories
Animals
Vegetables
Minerals

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

13 Nov 2006, 11:39 PM
#10
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: View all products in top level category?

Your client may not like this, but I'd suggest:

Animal Pictures
Vegetable Pictures
Mineral Pictures
Literature Books
Romance Books

as his main categories.

If its just a reduced amount of clicking he is looking for, then I would suggest the css flyout cagtegories add on.

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_52&products_id=75

That way the customers can get right to any category they want.

14 Nov 2006, 2:08 AM
#11
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

Good suggestion Clyde - but can I do that for each section of categories?

And Jettrue - I'm already using a modified version of the flyout menu (they don't want it to "fly out", but they do want it to expand and collpase - which I've done just fine) - but thanks for the suggestion :)

14 Nov 2006, 3:11 AM
#12
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: View all products in top level category?

doodlebee:

Good suggestion Clyde - but can I do that for each section of categories?

And Jettrue - I'm already using a modified version of the flyout menu (they don't want it to "fly out", but they do want it to expand and collpase - which I've done just fine) - but thanks for the suggestion :)

Next question... is this site going to have static categories and subcategories? Because the next step is to hard code the links to the categories to get what you want done in combination with some custom template edits. But if your client wants the ability to add/remove/edit products, that's not the way to go....

14 Nov 2006, 3:36 AM
#13
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: View all products in top level category?

You only mentioned two "categories"

Pictures

and

Books

right?

Books are "documents" (sort of!) so modify the document sidebox title to read books

then your categories would be Literature and romance

You'd end up with two sideboxes.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Nov 2006, 4:18 AM
#14
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

Jettrue - I had thought of hard-coding. I honestly don't know if there will eventually be a need to add more categories or anything - but I think it's something that should be left open and available to the client. I'd hate to "paint her in", if you know what I mean. It is an option, but I think it's a last resort.

I was thinking of editing my "category_row.php" file with a conditional - saying "if on the index page, then display the category links" but have the links actually link to the top-level subcategory rather than the top category itself...I've been looking for the actual code on how to link to a subcategory.

But Clyde there brings up an interesting thing - I have never heard of the "document type" - so I looked it up. I'm reading the thing on "Product Types" right now. From my initial understanding, it may be what I'm looking for...but the FAQ on it isn't very clear.

I have found the place to do the Product Types in the admin area...looks like I can create as many as I'd like from there (if I'm wrong, please correct me! EDIT: I'm wrong - I have to do some coding to create more - but I'm not adverse to getting my fingers a little dirty in "tweak mode" if I must) The article I'm reading is a technical standpoint (the programmer's view) - but I'm wondering if I'm understanding the basic aspect of this feature.

So, I could basically associate a subcategory with a product type, and then link to the product type, rather than the category itself? My wheels are turning right now - this could be the solution to this problem...thinking off the top of my head here...

If I could link to the product type itself from the index page...I could take the end user right to that area of images...I could even possibly have the product type display all images in that top-level category (couldn't I?)...and then I could keep the current sidebar navigation that links to everything by category and subcategory....see, that would be fine...I have no problem with that. I just need that initial entrance to be right there, you know? After that, it's all good.

This might work - if I can link to a product type directly. All I need is that inital entrance form the index page to basically "show all" in the one category that the end user chooses from.

If I'm thinking incorrectly, please someone let me know...but this could be the fix I'm looking for! I'm definitely investigating this further. Thanks for the nudge!

14 Nov 2006, 4:31 AM
#15
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: View all products in top level category?

I just remembered that there was a MOD for a BOOK product type

You can find it here in the archived downloads:

http://www.zen-cart.com/archived_contributions/product-types/

Take a look at it it might be something you could use.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Nov 2006, 4:34 AM
#16
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: View all products in top level category?

doodlebee:

But Clyde there brings up an interesting thing - I have never heard of the "document type" - so I looked it up. I'm reading the thing on "Product Types" right now. From my initial understanding, it may be what I'm looking for...but the FAQ on it isn't very clear.

If you only have two main categories (pictures and books) you could set up all pictures as "Product-General" products and all books as "Document-Products" products. I'm not sure if you really only have two main categories or if you were only using those two as an example, but if that is the case, that could be your solution.

Create the Main categories:
Animals
Vegetables
Minerals

as the default "Product-General" type, and create the books categories as "Document-Product" (be sure to restrict the category to only document product only)

THEN, under "Tools", "Layout Boxes Controller", turn on the "document_categories.php" box.

Then in includes/languages/YOUR_TEMPLATE/english.php, change
// categories box text in sideboxes/categories.php
define('BOX_HEADING_CATEGORIES', 'Categories');

to:

// categories box text in sideboxes/categories.php
define('BOX_HEADING_CATEGORIES', 'Pictures');

and in includes/languages/english/extra_definitions/YOUR_TEMPLATE/document_general.php

change:
DEFINE('BOX_HEADING_DOCUMENT_CATEGORIES', 'Documents');

to:

DEFINE('BOX_HEADING_DOCUMENT_CATEGORIES', 'Books');

Hope this makes sense (and that I didn't make any mistakes).

14 Nov 2006, 6:09 AM
#17
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: View all products in top level category?

jettrue,

I just spent an hour doing exactly what you describe on my test site.

Works like a charm.

The only thing i did that is different...

....create the books categories as "Document-Product" (be sure to restrict the category to only document product only)

add an additional restriction to document general only

You'd then have two restrictions showing.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Nov 2006, 7:30 PM
#18
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

Excellent, excellent jettrue - you are my hero for the day. This is working very nicely - I really appreciate the input.

Now I have 2 more questions, if I may:

  1. Now that I've moved things around, is there a way I can list only the top-level categories that are in one Product Type on the index page, rather than listing all of the top-level categories? (Does that make sense?)

  2. Now, in my sidebar, I would like the same sort of effect to go in - have the sidebar list categories by Product Type, rather than have it list all the categories. Right now, I have the main Product Type (Product - Prints, with the header changed as you suggested above - which worked like a charm!), but it's now listing all categories below if - even the ones not listed within that product type.

Of course, this couls also be because I'm using a modofied version of the flyout menu for my sidebar - so it may take some coding in that script to make this happen - so could someone point me in the right direction as to where I could obtain the proper information to insert into my current code?

14 Nov 2006, 11:43 PM
#19
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: View all products in top level category?

doodlebee:

Excellent, excellent jettrue - you are my hero for the day. This is working very nicely - I really appreciate the input.

Now I have 2 more questions, if I may:

  1. Now that I've moved things around, is there a way I can list only the top-level categories that are in one Product Type on the index page, rather than listing all of the top-level categories? (Does that make sense?)

  2. Now, in my sidebar, I would like the same sort of effect to go in - have the sidebar list categories by Product Type, rather than have it list all the categories. Right now, I have the main Product Type (Product - Prints, with the header changed as you suggested above - which worked like a charm!), but it's now listing all categories below if - even the ones not listed within that product type.

Of course, this couls also be because I'm using a modofied version of the flyout menu for my sidebar - so it may take some coding in that script to make this happen - so could someone point me in the right direction as to where I could obtain the proper information to insert into my current code?

#1) I don't understand what you mean, please explain.

#2) If you go to the category edit page (where you would write copy for the category) is it restricted to the "Document-Product" type?

15 Nov 2006, 2:25 PM
#20
doodlebee avatar

doodlebee

Inactive

Join Date:
Jan 2006
Posts:
228
Plugin Contributions:
0

Re: View all products in top level category?

  1. What I mean is, on the index page, I'm currently linking to each category. I have a small listing on the index page of all the top-level categories. However, now that I've "moved them up a level", I now have a category that I don't want to appear on the index page.

So, originally, it was set up so I had two main categories: "Pictures" and "Books". I had the "pictures" categories listed on the main page, but not "books". Now that I have removed those two categories, and moved all of the subcategories to top-level categories, all of the stuff that was in "Books" is now showing up on the index page as well. But I only want the "Pictures" subcategories to be on the index page.

Since "Pictures" is now a Product Type (Pictures), and "Books" is also another Product Type (Books), I was wondering if there was a way to specify only one product type to show on the index page, rather than showing them all.

  1. Maybe I've done something wrong (and maybe this is contributing to the problem above?). What I did was rename the stuff under "Product Types" - so it'd be easier to remember what was what.

"Products - General" became "Products - Pictures", and I followed your steps above to change the title in my sidebar, so it now reads "Pictures" (yay!) - this part is doing exactly what I want.

"Products - music" became "Products - Books".

However, my sidebar list is showing all of the categories like so:

Pictures

  • Animals
  • Vegetables
  • Minerals
  • Books
  • Romance
  • Literature

When I want it to look like this:

Pictures

  • Animals
  • Vegetables
  • Minerals

Books

  • Romance
  • Literature

And yes, I *do have the category restrictions set. Maybe it's because I have them all under "products" instead of moving the Books to "documents"? I'll swap that over and see what happens.

(Hopefully I cleared things up a bit!)

NOTE: did I alo mention I'm using an altered version of the flyout menu, so I could convert the sidebar into a nested list? I think I did. That also may be contributing to my problem. Sorry - I haven't had coffee yet this morning!