Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43
  1. #1
    Join Date
    May 2008
    Posts
    11
    Plugin Contributions
    0

    Default how to keep categories unfolded on sidebox?

    This is how I hacked up the zen-cart code to have the ability to unfold ANY or ALL categories to display sub-cats on all pages, not just the index page:

    open 'includes/classes/category_tree.php'

    1) change line 137

    -----------------------------------------------------------------------------------

    change

    if (zen_not_null($cPath)) {

    TO =>

    if (zen_not_null($cPath) or 1) {


    -----------------------------------------------------------------------------------

    2) insert code in lines 141-145

    ORIGINAL
    -----------------------------------------------------------------------------------

    reset($cPath_array);



    while (list($key, $value) = each($cPath_array)) {

    -----------------------------------------------------------------------------------

    insert =>

    $cPath_array = array(#,#);

    in between the reset and while commands.

    # equals the category ID you wish to be unfolded... you can have it only unfold one, or all... all would be #,#,#,#,# and so on until you have all the ID's inside the parenthesis.

    END RESULT
    -----------------------------------------------------------------------------------

    reset($cPath_array);

    $cPath_array = array(1,2,5,7);

    while (list($key, $value) = each($cPath_array)) {

    -----------------------------------------------------------------------------------

    hope this helps some people, my buddy and I spent 2 hours trying to figure this one out. tried to add some hyphens in here for reading pleasure and such... do not insert the page breaks I made. ENJOY!!!

    Any questions let me know, this is what worked for me.

  2. #2
    Join Date
    Jul 2008
    Posts
    17
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    How does it work?

  3. #3
    Join Date
    Nov 2007
    Posts
    37
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    I inserted what you had and only the 3rd cat was unfolded. Could you explain more about the id's or ###.

    Thanks
    Dave

  4. #4
    Join Date
    Mar 2008
    Posts
    148
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    Huge pat on the back, thank you very much.

    btw your line number were way different than mine, the code you speak of occurs starting on line 70 for me. I'm on 1.3.8, not sure if that is what the difference is but it still works great. Thanks.

  5. #5
    Join Date
    May 2008
    Posts
    11
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    every category/subcat has an ID

    example:

    id : catname

    1:shoes
    -3:nike
    -4:adidas
    2:shirts

    you can only 'unfold' categories with subcategories... it's not going to list products there... so in this instance, you would just use ID 1 there.... if shirts had subcats, you would include ID 2... and so on. only use cat IDs there with subcats inside there.

    hope that helps...

  6. #6
    Join Date
    Feb 2008
    Posts
    60
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    Quote Originally Posted by Qwert302 View Post
    btw your line number were way different than mine, the code you speak of occurs starting on line 70 for me. I'm on 1.3.8, not sure if that is what the difference is but it still works great. Thanks.
    nice hack!! was looking for that and didnt want to add a mod for just a small change

    I also had the lines of this code in different location, am using 1.3.8a here is my code starting from line 70-73;
    Code:
    if (zen_not_null($cPath) or 1) {  //addes this "or 1)" to always open subcategories
          $new_path = '';
          reset($cPath_array);
    	  $cPath_array = array(15); // added this line to always open categorie #15 > subcategories
    Works great!

  7. #7
    Join Date
    Aug 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    Thank you so much. I spent like 6 hours trying to find this!!!

  8. #8
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    Can you post a website we can view how it works?

    Thanks,
    Kim

  9. #9
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    I can not get this to work.

    Code starts on line70. I have version 1.3.8

    if (zen_not_null($cPath) or 1) {
    $new_path = '';
    reset($cPath_array);
    $cPath_array = array(82,83,84,111,112,113,114,115);
    while (list($key, $value) = each($cPath_array)) {

    I first tried my top category, but did not work. I went deeper into sub-category and still does not work.

    Help!
    Thanks,
    Kim

  10. #10
    Join Date
    Aug 2008
    Posts
    19
    Plugin Contributions
    0

    Default Re: how to keep categories unfolded on sidebox

    Thank YOU!!!

    This is what i wanted to do from the start.

    i have 1.3.8a and i also had the line starting at 70

    This should be faq'd

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. Disable My Account sidebox, but keep Login sidebox??
    By Upsiaus in forum Basic Configuration
    Replies: 2
    Last Post: 11 Oct 2011, 11:07 PM
  2. How NOT to show categories on main page but still keep the subcategories open?
    By Cindy2010 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Jun 2010, 06:24 AM
  3. how to keep subcategory always on in the sidebox?
    By rich00693 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 4 Apr 2009, 04:32 PM
  4. How do I keep featured items from showing in categories
    By hookah in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Oct 2008, 10:00 PM
  5. How to display sub-categories in categories sidebox?
    By icaros in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Oct 2007, 12:22 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