Page 1 of 2 12 LastLast
Results 1 to 10 of 249

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Posts
    57
    Plugin Contributions
    2

    Default Re: Simple Category Tree

    Any help with that code yellow1912? It's been about a week and a half...

  2. #2
    Join Date
    Mar 2008
    Posts
    32
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Hi, I am building my first zen cart and am learning loads. Yellow1912, I have been playing around with your contrib. and it's great, thanks!.
    I have been trying to display ONLY the first sub-cat level all the time in the header using :

    $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath']{0}, 0)

    But get the next level with it expanded also. Any way of just giving the first sub-cats only after selection of top cat elsewhere on the page?
    I have also tried:
    $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath']{0}, 1)

    Thanks, DanP

    p.s. I am also looking forward to script for 'list all products under category selected'

  3. #3
    Join Date
    Oct 2005
    Posts
    71
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    I've been trying to find a way to display only the subcategories in the sidebox of the corresponding Parent Categories when that Category is selected on the Horizontal Tab. I thought I got it working until I clicked on the other categories but it still displays Subcategories of the First category instead of its own.

    I have this code in the Category Sidebox template:

    $content .= $_SESSION['category_tree']->build_category_string('', 'li', '<br />', 1, 1);

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Simple Category Tree

    Display all sub cat products module included !!!
    Attached Files Attached Files
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    May 2006
    Posts
    80
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Wooooo hooo.

    I think the number of Zenners this will help may be underestimated. Ive been looking for this for over a year!

    I will give this a try first thing in the morning.

    THANKS SO MUCH!!!!

  6. #6
    Join Date
    Mar 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Thank you soooo much for your great effort. Was looking for it for quite some time. I tried it and it works. The only thing was that I had to add a space after the 'select distinct' statement in the index_filters/default_filter.php.

    I

  7. #7
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Simple Category Tree

    Quote Originally Posted by Noella View Post
    I've been trying to find a way to display only the subcategories in the sidebox of the corresponding Parent Categories when that Category is selected on the Horizontal Tab. I thought I got it working until I clicked on the other categories but it still displays Subcategories of the First category instead of its own.

    I have this code in the Category Sidebox template:

    $content .= $_SESSION['category_tree']->build_category_string('', 'li', '<br />', 1, 1);
    Oh, first, if you use li for the the child then you need to use ul for the parent cats.
    Also, if you need to display subcats of the current cat you need to pass that parent cat id into it *using $cPath or $_GET['cPath']
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  8. #8
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Simple Category Tree

    Quote Originally Posted by DanP View Post
    Hi, I am building my first zen cart and am learning loads. Yellow1912, I have been playing around with your contrib. and it's great, thanks!.
    I have been trying to display ONLY the first sub-cat level all the time in the header using :

    $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath']{0}, 0)

    But get the next level with it expanded also. Any way of just giving the first sub-cats only after selection of top cat elsewhere on the page?
    I have also tried:
    $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath']{0}, 1)

    Thanks, DanP

    p.s. I am also looking forward to script for 'list all products under category selected'
    This $_GET['cPath']{0} looks weird, im pretty sure it is wrong.
    Try this:
    $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath'], 1, false, true);

    Also, make sure that you use an if statement to make it appears only if $_GET['cPath'] exists.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  9. #9
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Simple Category Tree

    Fixed a few bugs with displaying all sub products.
    For those who already installed it, simply over-write the default_filter.php
    Attached Files Attached Files
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  10. #10
    Join Date
    May 2006
    Posts
    80
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Thanks for the mods, I have been playing around with them on a test site and they are great. I see many uses!

    I currently have the following code in my cat tree:
    HTML Code:
    <?php
    $content = '';
      if($cPath == 3)
         $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath'], 1); 
      elseif($cPath == 2)
         $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath'], 1); 
      else
         $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 0, 2);  
    
    ?>
    This shows either the top 2 categories. OR for cPath 2 and cPath3 it shows just the subcategories in this.

    Is it possible to extend this so that cPath 2_549_651 and cPath 2_549_652 and cPath 2_549_653 (for example) shows the categories in cPath 2_549.

    I have tried adding this code to my initial code:

    HTML Code:
    <?php
    $content = '';
      elseif($cPath == 2_549)
         $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 549, 1);
    I have also tried:
    HTML Code:
    <?php
    $content = '';
      elseif($cPath == 549)
         $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 549, 1);
    None of these work and it is still been controlled by the initial elseif cpath 2 statement.

    Any ideas what I am on about and it is possible to achieve my desired result?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Category Tree
    By fneergaard in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Aug 2010, 11:42 PM
  2. Redesigning Category Tree
    By moomo in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 30 Dec 2009, 01:53 PM
  3. Category tree
    By ner0tik in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 10 Aug 2006, 02:19 AM

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