Page 1 of 7 123 ... LastLast
Results 1 to 10 of 63
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,585
    Plugin Contributions
    30

    Default Display Categories In Separate Boxes

    Hi,
    regarding the
    Display Categories In Separate Boxes v1.0
    add-on from here
    http://www.zen-cart.com/index.php?ma...oducts_id=1231

    it appears to be incomplete as in

    \includes\templates\TEMPLATE\sideboxes\tpl_separate_category_sidebox.php

    there is no code to display the retrieved category information.

    regards
    Steve

  2. #2
    Join Date
    Feb 2008
    Posts
    1,336
    Plugin Contributions
    1

    Default Re: Display Categories In Separate Boxes

    Did you install the mod following the instructions??? Technically you don't need the files in the template folder to operate any mod. They are there to style the mods and make them load inside your template. The module folder loads the sidebox.

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,585
    Plugin Contributions
    30

    Default Re: Display Categories In Separate Boxes

    Hi,
    thanks for the quick reply.

    I copied the three files to their respective locations as per the instructions but when displayed in the shop, the new sidebox is empty, irrespective of the category c.parent_id number.

    Looking at other sideboxes, the actual content is loaded into the $content variable by the file here
    \includes\templates\TEMPLATE\sideboxes\tpl_ANY_sidebox.php
    and then I assume passed onto the main page code.

    But in the case of this mod
    \includes\templates\TEMPLATE\sideboxes\tpl_separate_category_sidebox.php

    nothing is loaded into $content apart from the start and end div tags, and so that is what is displayed.

    Maybe I am missing the point of this mod.
    I assumed it was a way to separate the master (or sub) categories into separate boxes, maintaining the sublayer links.

    regards
    Steve

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

    Default Re: Display Categories In Separate Boxes

    This mod is built to display a single category of your choosing in a separate sidebox. I haven't checked to see if it will display that category's subs.

    It will not remove the category from the regular categories sidebox.

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

    Default Re: Display Categories In Separate Boxes

    On inspection, it looks like it will display the subcategories of a chosen category in the sidebox.
    It also displays them in <li> tags, without a containing set of <ul> tags anywhere.

  6. #6
    Join Date
    Feb 2008
    Posts
    1,336
    Plugin Contributions
    1

    Default Re: Display Categories In Separate Boxes

    The mod will only display sub-categories of a master category in the box. They will be displayed in a <li> which can be styled easily to give a more elegant look to your tree.

    You can hide the category using the Zen Cart admin, or manually code it into the categories sidebox.

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

    Default Re: Display Categories In Separate Boxes

    The <li>s need to be inside a set of <ul> tags to avoid an HTML error.

  8. #8
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,585
    Plugin Contributions
    30

    Default Re: Display Categories In Separate Boxes

    Hi,
    1) The point I was making at the start of this thread is that the code in the template file:
    PHP Code:
    $content '';
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">';
    $content .= '</div>'
    will not display anything until the last line is changed to

    PHP Code:
    $content .= $add_content .'</div>'
    2) The generated list lacks an UL, so in

    \includes\modules\sideboxes\TEMPLATE\separate_category_sidebox.php

    change this

    PHP Code:
        $add_content ='';
        
        while (!
    $categories_ap->EOF)  {
            
    $id $categories_ap->fields['categories_id'];
            
    $name $categories_ap->fields['categories_name'];
              
    $add_content .= '<li><a href="index.php?main_page=index&cPath='.$id.'" class="category-top">'.$name.'</a></li>' "\n";
            
            
    $categories_ap->MoveNext();
        } 
    to this:

    PHP Code:
        $add_content ='<ul class="separatesideboxlist">';
        while (!
    $categories_ap->EOF)  {
            
    $id $categories_ap->fields['categories_id'];
            
    $name $categories_ap->fields['categories_name'];
              
    $add_content .= '<li><a href="index.php?main_page=index&amp;cPath='.$id.'">'.$name.'</a></li>' "\n";
        
            
    $categories_ap->MoveNext();
        }
        
    $add_content .= '</ul>'
    3) The query that gets the category information does not account for languages or table prefixes (I think), so change

    PHP Code:
    $categories_query_ap "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from categories c, categories_description cd where c.categories_id = cd.categories_id and c.categories_status = 1 and c.parent_id = 76 order by sort_order, cd.categories_name"
    to
    PHP Code:
    $categories_query_ap "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd " 
    "where c.categories_id = cd.categories_id 
    and c.categories_status = 1 
    and c.parent_id = 2 //select master category 
    and cd.language_id = '" 
    . (int)$_SESSION['languages_id']  . "'" ." order by sort_order, cd.categories_name"
    Otherwise it works as advertised, showing a non-expanding list of the subcategories of a master category, which is fine by me

    regards
    Steve

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

    Default Re: Display Categories In Separate Boxes

    My apologies, I didn't go through the first posts thoroughly to get the full import (I think I had just awakened... more or less:).
    It looks like you have fixed all of the problems with the mod; you might want to package it and submit an update so others can get the correct functionality from it.

  10. #10
    Join Date
    Nov 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Display Categories In Separate Boxes

    Hi All,

    I have been searching for a sidebox with this functionality for so long and so relieved to find this thread!

    I've followed all the instructions in the read me file and also the modifications to the files in this thread, but the seperate categories sidebox still doesn't display the category that I want.

    Referring to the readme file:

    ---------------
    This sidebox will display the content of Any Category you choose in a separate sidebox. To define the Category you wish to display open the file: includes/modules/sideboxes/Your_Template around line 20 find:
    and c.parent_id = 76 Change the 76 to the master_category_id from your site.
    ---------------

    How do I find out the: master_category_id ?

    also is it possible to have multiple categories in this new seperate box?

    Thanks All

 

 
Page 1 of 7 123 ... LastLast

Similar Threads

  1. v151 2 Separate Boxes on Different Category Type
    By PanZC2020 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Aug 2016, 09:40 PM
  2. Separate quantity boxes for different attributes
    By ::AnanA:: in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 7 Oct 2008, 02:21 PM
  3. Separate Top Categories from Sub-Categories in Layout?
    By msmith29063 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Feb 2008, 06:56 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