Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    16
    Plugin Contributions
    0

    Default Hide categories and tree categories sidebox

    Hi,

    I've recently been setting up my store with a css dropdown menu, tree menu categories side box and hide categories. I got the dropdown menu to work by copying the sql query from the hide categories site map modification and pasting it into the categories_ul_generator.php file.

    Now I am trying to do a similar thing to the includes/modules/treemenu.php file to get the treemenu to hide categories.

    The original treemenu query looks like this:

    function zen_treemenu_get_catalog($id_parent, $position, $str_cPath, $first_element='true'){
    global $tree_menu_items, $db, $tree_menu_noscript;
    $groups_cat = $db->Execute("select c.categories_id, cd.categories_name, c.parent_id
    from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
    where c.parent_id = '" . (int)$id_parent . "'
    and c.categories_id = cd.categories_id
    and cd.language_id='" . (int)$_SESSION['languages_id'] . "'
    and c.categories_status= '1'
    order by sort_order, cd.categories_name",
    '', false, 150);

    This appears to be the query that needs to be rewritten.
    ...but there are a couple other places that may to be fixed as well:

    // don't build a tree when no categories
    $check_categories = $db->Execute("select categories_id
    from " . TABLE_CATEGORIES . "
    where categories_status=1 limit 1");

    ...and:

    function zen_has_products_in_category_and_subcategories($id_categories) {
    global $db;
    if (!TREEMENU_SKIP_EMPTY) return true;
    $id_cateqories_products = $db->Execute("select count(*) as total
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
    where p.products_id = p2c.products_id
    and p2c.categories_id = '" . (int)$id_categories . "'
    and p.products_status = '1'");
    Anyone know this?

    A.D.

  2. #2
    Join Date
    Jan 2011
    Posts
    16
    Plugin Contributions
    0

    Default Re: Hide categories and tree categories sidebox

    ...and here is the answer, for anybody else who needs it.
    The main query is all that seems to need to be changed.

    $groups_cat = $db->Execute("select c.categories_id, cd.categories_name, c.parent_id
    from " . TABLE_CATEGORIES . " c LEFT JOIN "
    . TABLE_HIDE_CATEGORIES . " h ON (c.categories_id = h.categories_id), "
    . TABLE_CATEGORIES_DESCRIPTION . " cd
    where (h.visibility_status < 2 OR h.visibility_status IS NULL)
    and c.parent_id = '" . (int)$id_parent . "'
    and c.categories_id = cd.categories_id
    and cd.language_id='" . (int)$_SESSION['languages_id'] . "'
    and c.categories_status= '1'
    order by sort_order, cd.categories_name",


 

 

Similar Threads

  1. Ssimple categories tree
    By Laki in forum Addon Sideboxes
    Replies: 0
    Last Post: 15 Sep 2015, 04:32 PM
  2. Uncollapsed Categories Tree
    By fragfutter in forum Addon Sideboxes
    Replies: 36
    Last Post: 2 Feb 2014, 08:46 PM
  3. Categories tree modifications
    By Dan123 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Mar 2012, 09:21 AM
  4. Categories tree
    By swaper in forum Addon Sideboxes
    Replies: 5
    Last Post: 3 Feb 2011, 02:11 PM
  5. Categories Tree Text Size and wrap alignment
    By Quilthug in forum General Questions
    Replies: 3
    Last Post: 23 May 2007, 11:05 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