Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    3
    Plugin Contributions
    0

    Default Defining a subcategory - code problems

    So I'm skinning zencart for a client. I installed a sidebox called category product list. It reveals all the subcategories as well as top categories. Well I ran into a problem:

    The "subcategories" get tagged with the class "category-products", meaning that when i add a product to the subcategory, the products show in the menu as well. It would't be a problem if they were classed differently. I could set the products to display: none.

    My question is: How do I get subcategories to display the proper class in the HTML? Is there a control in the admin panel? This is driving me nuts, and I'm a seasoned developer.

    The site is http://wearitagainsamvintage.com/shop/

    The heirarchy should be as such:
    Women's
    Day Dresses
    (no products)

    If anyone could help, I'd appreciate it. Thanks!

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Defining a subcategory - code problems

    I'm not sure this is a CSS thing, though I haven't used that mod.

    Just to check - the Women's category is in Top, and only contains the Day dresses subcategory, which only contains the product1 ?

    It kind of looks like you have that product in the Day dresses subcat as well as the Top category, which won't work.

  3. #3
    Join Date
    Jul 2010
    Posts
    3
    Plugin Contributions
    0

    Default Re: Defining a subcategory - code problems

    Thanks for the reply. It's definitely not a CSS issue. Here's the culprit, located in template_default/sideboxes/

    // set top style
    if ($box_categories_array[$i]['top'] == 'true') {
    $a_class = 'category-top';
    } elseif($box_categories_array[$i]['has_sub_cat']) {
    $a_class = 'category-subs';
    } else {
    $a_class='category-products';
    }

    Yes, you are correct:
    "Just to check - the Women's category is in Top, and only contains the Day dresses subcategory, which only contains the product1 ?"
    I want only the top and subcategories to display in the sidebar, but no products. The problem is that the above php conditionals generate this:

    <a class="category-top" href="#">Women's</a></li>
    <a class="category-products" href="#">Day dresses</a></li>
    <a class="category-products" href="#">Product1</a></li>

    It's defining the subcategory "Day Dresses" as a product.

    I'd like it to be:
    <a class="category-top" href="#">Women's</a></li>
    <a class="category-sub" href="#">Day dresses</a></li>


    Any idea why? I know I'm doing something wrong, but I'm not sure what. Seems like it's a problem on the admin side. Dunno.

    I appreciate any insight...

    Thanks,
    Sal

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Defining a subcategory - code problems

    Try adding a product to the Party dresses subcategory and see if it does the same thing.

  5. #5
    Join Date
    Jul 2010
    Posts
    3
    Plugin Contributions
    0

    Default Re: Defining a subcategory - code problems

    Quote Originally Posted by stevesh View Post
    Try adding a product to the Party dresses subcategory and see if it does the same thing.
    Same thing
    Check it out:
    http://wearitagainsamvintage.com/sho...php?main_page=

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

    Default Re: Defining a subcategory - code problems

    .category-products is a marker for a subcat that has no subcats, only (possibly) products. It does not refer to actual product items. There is no error there.
    Your mod is apparently built to display the products as well as categories in the sidebox. If you don't know enough PHP to modify its code, you can use another mod instead. Fragfutter's "Uncollapsed Category Tree" mod, hosted on his site and accessible from his thread in the forum, is reliable and easy to install, and will display all the categories and nothing else.
    If you want more control over which categories display, use Categories Dressing from Free Addons.

 

 

Similar Threads

  1. Replies: 3
    Last Post: 1 Sep 2013, 05:47 AM
  2. Problems defining PHP CONSTANTS eg. TOP_MENU_HOME
    By moltres93 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Sep 2011, 05:48 AM
  3. easy populate problems? products both exist under category and subcategory.
    By alvalong in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 3 Aug 2008, 09:25 AM
  4. Banner HTML code to link to subcategory
    By ooakllc in forum Basic Configuration
    Replies: 3
    Last Post: 27 Jul 2008, 05:35 AM
  5. subcategory description layout - stuck in code
    By LittleR in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 31 Oct 2007, 03:01 PM

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