Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 70
  1. #51
    Join Date
    Jan 2006
    Posts
    420
    Plugin Contributions
    0

    Default Re: Parent Categories Separated In 3 sideboxes

    Hi Glenn , hopefully your monitoring this thread , and I apologise for keep coming back on this one. Usually once shown I understand , this category array is very confusing ( to me )

    Anyway At the moment I followed your code and it works great I have only the sub cats showing for any one top cat - the question is if I am at home page or anyother page thats not in a Cat , can I have the top cats back ?

    Thanks for any help.

    Mark
    Various Zen cart sites !

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

    Default Re: Parent Categories Separated In 3 sideboxes

    You can add a test for cPath not blank or zero. It will have a value if you are in a category. Something like:

    if (($_GET[cPath] != 0 and substr_count($box_categories_array[$i]['path'],'_') == 0) or ...

    It may require a slightly different formulation, but this general approach should work.

  3. #53
    Join Date
    Jan 2006
    Posts
    420
    Plugin Contributions
    0

    Default Re: Parent Categories Separated In 3 sideboxes

    Quote Originally Posted by gjh42 View Post
    You can add a test for cPath not blank or zero. It will have a value if you are in a category. Something like:

    if (($_GET[cPath] != 0 and substr_count($box_categories_array[$i]['path'],'_') == 0) or ...

    It may require a slightly different formulation, but this general approach should work.
    Spot on !!

    Thanks that is just what I needed , for anyone else needing the same as me , this is a section from my tpl_categories :-
    PHP Code:
    // subcat limit 2007-12-20
          
    if (($_GET[cPath] != and substr_count($box_categories_array[$i]['path'],'_') == 0) or zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    Thanks again .
    Various Zen cart sites !

  4. #54
    Join Date
    Jun 2007
    Posts
    122
    Plugin Contributions
    0

    Default Re: Parent Categories Separated In 3 sideboxes

    Thanks for your help on this.

    I have a couple of other questions, that mayby you can help me with.

    Can I set a default catagory to show when someone goes to the home page.

    Also is it possible to show the current catagory selected where the catagory box title is.

    A bit off the subject but I am aslo struggling to find the correct place in the stylesheet.css for the the header bar and the side box sub catagories. I want to show which catagory is currently selected, by changing colour, and also show a hover and selcted colour change in the sub catagories in the sidebox.

    Thanks for any help.

    Regards
    Laurie

  5. #55
    Join Date
    Jan 2006
    Posts
    420
    Plugin Contributions
    0

    Default Re: Parent Categories Separated In 3 sideboxes

    Quote Originally Posted by chalfontgifts View Post
    Thanks for your help on this.

    I have a couple of other questions, that mayby you can help me with.

    Can I set a default catagory to show when someone goes to the home page.
    This is done in the admin / Config / layout settings

    Main Page - Opens with Category = enter the cat ID in here

    Quote Originally Posted by chalfontgifts View Post

    Also is it possible to show the current catagory selected where the catagory box title is.


    Thanks for any help.

    Regards
    Laurie
    I tried to do this to never did find a way to do it and gave up for the time being , but would be interested in a soldi way of achieving this as it should be easy enough to have a dynamic language define to sort it out.

    Good luck !
    Various Zen cart sites !

  6. #56
    Join Date
    Jun 2007
    Posts
    122
    Plugin Contributions
    0

    Default Re: Parent Categories Separated In 3 sideboxes

    Solution for the above is posted here, Thank you glen.

    http://www.zen-cart.com/forum/showth...955#post607955

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

    Default Re: Parent Categories Separated In 3 sideboxes

    For the cetegory selected/hover indication, look at the /classic/ stylesheet. There is a section for parent/child categories which shows the classes you can address.

  8. #58
    Join Date
    May 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Parent Categories Separated In 3 sideboxes

    Well, I was really sure I could get it working without assistance... It *does* work, but not on the home page, and I'm seriously stumped.

    I'm going for the "subcats only" variant here, one top category per box. The relevant snippets of code are below:

    PHP Code:
      /* test for cats to display */
        
    if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'2,2_4,2_5'))) { 
    So only Cpath 2 and the two subcats that are set up at the moment... fairly simple.

    PHP Code:
    // subcat limit 2007-12-20
          
    if (substr_count($box_categories_array[$i]['path'],'_') == or zen_get_product_types_to_category($box_categories_array[$i]['path']) == or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
            
    // skip if this is for the document box (==3)
          
    } else { 
    And the subcat code, which works. Except the box shows empty on the home page. If I go to the top category listing, or a product, or anywhere else, I get just the two subcats in the box as I want it.

    How is this possible? Thanks in advance for any advice.

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

    Default Re: Parent Categories Separated In 3 sideboxes

    When you are on the home page, you haven't chosen a category (unless you have set "Main Page opens with" to a specific category); therefore, $cPath will be empty and none of your chosen cats will display.

    This bit of code
    if (substr_count($box_categories_array[$i]['path'],'_') == 0
    skips all top categories in the display all the time.

    The
    if(in_array(
    already only displays the categories or subs you specify. Since you don't want any top cats, eliminate the substr_count( part, and eliminate the 2, in the explode( function.

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

    Default Re: Parent Categories Separated In 3 sideboxes

    OK, a bit of clarification.
    You have done the "separate boxes" cloning bit?
    And you are wanting to display the subcats of one category in one of the boxes, all the time?

    Do you have an expanded categories mod installed? If not, there will be no subcats in the category tree to display unless you are in the particular top cat.

 

 
Page 6 of 7 FirstFirst ... 4567 LastLast

Similar Threads

  1. Category Filter - Display Parent categories
    By djdavedawson in forum General Questions
    Replies: 1
    Last Post: 5 Oct 2010, 10:08 PM
  2. Subcategories products in Parent Categories
    By fightthefourwalls in forum Setting Up Categories, Products, Attributes
    Replies: 21
    Last Post: 14 Jun 2010, 07:58 PM
  3. Enable Links for Parent Categories in Categories Sidebox
    By MrsQ in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 Sep 2009, 08:25 PM
  4. Parent... Child... Sub.... CATEGORIES
    By eliza-bee in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 12 May 2009, 03:03 PM
  5. Parent categories in dropdown filter
    By Ben in forum Customization from the Admin
    Replies: 3
    Last Post: 15 Aug 2006, 02:38 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