Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2006
    Location
    San Diego, CA
    Posts
    29
    Plugin Contributions
    0

    Default Limit subcategory display in sidebox to one level only

    Hopefully this is a simple fix that I am just overlooking. As the subject states, I want to limit how deep the subcategory listing goes to just one level. Reason being is that each subcategory (level 1) has at least 20-30 categories after it and that would just make the sidebox look a bit crazy. If it was less, that would be a different story.

    I read on a previous post that someone just suggested breaking it up a bit more...which would work, but basically I am dealing with a comic book store with a long list of titles so there is still some necessity for a subcategory with many many categories below it.

    An example of what I am trying to do:

    -current-
    Manga
    -English
    -multiple categories for each series or for a single alphabetical letter
    -Japanese
    -multiple categories for each series or for a single alphabetical letter

    -what i'm trying to accomplish-
    Manga
    -English
    -Japanese

    One solution I've thought of was to just turn off subcategories listing under layout settings, but I still prefer to have at least the first level listed. If this can't be done, then I guess I can live with that, but hopefully someone knows what I should edit to get the ideal setting right. :)

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Limit subcategory display in sidebox to one level only

    So how do you propose navigating to the sub-subcats? By picking from a list/grid in the center column? Only the currently active set of subcats will be shown (in either location), and I personally would appreciate being able to just go down an alphabetical list (even 30 items long) instead of having to scan a grid spread over a large area of the center.

    What you have is actually

    -current-
    Manga
    -English
    -multiple categories for each series or for a single alphabetical letter
    -Japanese

    or
    -current-
    Manga
    -English
    -Japanese
    -multiple categories for each series or for a single alphabetical letter


    If you really think your customers will be happier not having this feature, there is a relatively simple mod I can work up for tpl_categories.php that will do this.

  3. #3
    Join Date
    Feb 2006
    Location
    San Diego, CA
    Posts
    29
    Plugin Contributions
    0

    Default Re: Limit subcategory display in sidebox to one level only

    Yeah, it was my intention to use the center as the way to navigate the level 2 subcategories. I've seen it used on Japanese comic store sites in a manner that was still very readable. Granted, what they had setup on the center is something that would require me to do a bit of modding to emulate. First step first though, right? :)

    If there is a simple way of achieving what I am trying to do, I am more than grateful to accept any help you are willing to offer. Muchly appreciated. :)

    Chris

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Limit subcategory display in sidebox to one level only

    In /includes/templates/your_template/sideboxes/tpl_categories.php, find around line 31
    PHP Code:
         if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    and add

    ereg("_.*_", $box_categories_array[$i]['path']) or

    to get
    PHP Code:
         if (ereg("_.*_"$box_categories_array[$i]['path']) or zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    This skips the item display if there are two or more _ in the cPath.
    Last edited by gjh42; 1 Oct 2007 at 03:57 AM.

  5. #5
    Join Date
    Oct 2007
    Posts
    29
    Plugin Contributions
    0

    Default Re: Limit subcategory display in sidebox to one level only

    I have a question very similar to this...

    Is there an easy way to make it so all categories with subcategories are always expanded?

    Only 2 of my categories have subcategories, and each one only has 2 subcategories, and our list is rather short, and I would prefer to be able to save our customers the extra click.

  6. #6
    Join Date
    Oct 2007
    Posts
    29
    Plugin Contributions
    0

    Default Re: Limit subcategory display in sidebox to one level only

    Nevermind, I found what I needed: http://www.zen-cart.com/index.php?ma...roducts_id=712

  7. #7
    Join Date
    Dec 2004
    Posts
    104
    Plugin Contributions
    0

    Default Re: Limit subcategory display in sidebox to one level only

    Quote Originally Posted by gjh42 View Post
    In /includes/templates/your_template/sideboxes/tpl_categories.php, find around line 31
    PHP Code:
         if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    and add

    ereg("_.*_", $box_categories_array[$i]['path']) or

    to get
    PHP Code:
         if (ereg("_.*_"$box_categories_array[$i]['path']) or zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    This skips the item display if there are two or more _ in the cPath.


    Thanks, That works great for me! I am using the documents sidebox to hold a secondary part of my categories. This page explains more of what I am up to. You were helping me there too!

    http://www.zen-cart.com/forum/showthread.php?t=88900

    I used these instructions: http://www.zen-cart.com/forum/showth...category+boxes


    What can I do to cause the documents sidebox to only show categories and subcategories, put no products when opened up (just like it works on the category box in the example you gave above)?

    I would guess that I need to put something similar in tpl_document_categories.php from bettercategories

    or maybe in tpl_document_general_info_display.php

    I am just guessing. Thanks for any help you can offer.

 

 

Similar Threads

  1. Display individual sidebox on only one Ez Page
    By creamcrackers in forum General Questions
    Replies: 10
    Last Post: 29 Mar 2012, 04:06 PM
  2. display only one feature product in sidebox
    By MatchManhattan in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 21 May 2008, 06:53 AM
  3. Display custom sidebox only on one page.
    By shackle in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Aug 2007, 09:28 PM
  4. Show only ONE subcategory!?
    By hondrelis in forum General Questions
    Replies: 0
    Last Post: 21 Nov 2006, 01:47 PM
  5. Show only one subcategory!?
    By hondrelis in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 14 Nov 2006, 01:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR