Page 19 of 25 FirstFirst ... 91718192021 ... LastLast
Results 181 to 190 of 249
  1. #181
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Quote Originally Posted by yellow1912 View Post
    What are you trying to do?
    Define session, then call on session with $content by the looks of things.

    So I have now changed the code as follows

    <?php
    $_SESSION['category_tree']->build_deepest_level_children(), retrieve_cpath();
    $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 0, 2);
    ?>

    ...but this, too, is not correct.

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

    Default Re: Simple Category Tree

    Define session, then call on session with $content by the looks of things.

    --> Can you explain?

    And the code you posted is wrong by the way, what are you trying to do with retrieve_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

  3. #183
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    I am just trying to make the tree display as follows:

    category1
    subcategory1
    product1
    category2
    subcategory2
    product2

    etc.

    If $session needs to define all that is then called on by $content to build the desired tree it is logical to assume that all that needs to be defined, except the layout parameters (which appear to be handled by $content), needs to be defined in the $session, so I need to work out some way of entering more definitions into the $session line or some way of being able to call on multiple $session variables in the $content line.

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

    Default Re: Simple Category Tree

    Note:
    This tree does not contain product, you will have to modify it if you want it to do what you want.

    I think you may need to read more about php regarding:
    1. Class and methods
    2. Session

    You will also need to know that $content is simply a normal variable, it just happens that the way Zen sidebox works is: you stuff all the content of the sidebox into this variable, and Zen will print it out for you.

    You can always do something like

    $content = '';

    $content .= 'first line<br />';
    $content .= 'second line<br />';
    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. #185
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Yes, I do need to update my knowledge of PHP, but practical usually works best for me and once I have the outline I will quickly develop my skills where Zen Cart is concerned.

    I now have the following (working) code...

    ...but still not to products level

    PHP Code:
    <?php
    $content 
    '';
    $content .= $_SESSION['category_tree']->build_category_string('ul''li'''02);
    $content .= $_SESSION['category_tree']->build_deepest_level_children();
    $content .= $_SESSION['category_tree']->retrieve_categories_tree_array();
    ?>
    I guess that when you said about adding products myself you were meaning that the tree does not contain that kind of functionality, so I would have to expand on the existing code and effectively build a new module? ...and the simple_category_tree and all_subcat_produts can only give you tree levels down to subcategory only?
    Last edited by some name not taken; 26 Oct 2008 at 09:15 AM.

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

    Default Re: Simple Category Tree

    Yes, the tree does not go to product level, you will have to add that if you want to, basically it's not so hard, just traverse the tree and query products id then attach them there.
    This type of functionality is not planned for this module in any near future, but you can add if you want to.

    There is a module in the download that returns a tree with product level, however.
    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

  7. #187
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Quote Originally Posted by yellow1912 View Post
    Yes, the tree does not go to product level, you will have to add that if you want to, basically it's not so hard, just traverse the tree and query products id then attach them there.
    This type of functionality is not planned for this module in any near future, but you can add if you want to.

    There is a module in the download that returns a tree with product level, however.
    modules -> pages -> index -> header_php.php?

    OK, thanks, but as the files from all_subcats_products basically overwrote the existing files for simple_category_tree that should mean that the line

    $_SESSION['category_tree']->build_deepest_level_children();

    will retrieve things on a product level, otherwise this line effectively does nothing.

  8. #188
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    The code still won't display subcategories...

    PHP Code:
    $_SESSION['category_tree']->build_deepest_level_children() 
    ...simple, yes, but still not working.

    Full code
    PHP Code:
    <?php
    $content 
    '';
    $content .= $_SESSION['category_tree']->build_category_string('ul''li'''02);
    $content .= $_SESSION['category_tree']->build_deepest_level_children();
    $content .= $_SESSION['category_tree']->retrieve_cpath()
    ?>
    Last edited by some name not taken; 26 Oct 2008 at 09:49 AM.

  9. #189
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    Right, I've added a 'li' value to accomodate the subcategory line, but cannot get the subcategory to display - I just get li showing where the subcategory should be.

    (The first number in the brackets indicates the category ID, so a value of 0 shows all category IDs, but 1 would only show category 1, 2 for category 2 only, etc. whilst the second number controls the subcategories... if you can get them to display, that is).

  10. #190
    Join Date
    Sep 2008
    Posts
    106
    Plugin Contributions
    0

    Default Re: Simple Category Tree

    So, it looks like even with the correct syntax subcategories, like actual products, cannot be displayed either ...and certainly not in any kind of unordered list.

    Well, it would have been useful to know that several hours ago.

    Thanks for your time and help anyway, Yellow.

 

 
Page 19 of 25 FirstFirst ... 91718192021 ... 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

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