Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hiding Categories

    I am afraid you have an error in your SELECT as you are also picking up the Top Level categories_id that have subcategories in them ...

    Is your intent to pick categories_id where there are active products "somewhere" within the branch or within the active products' active categories_id ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #12
    Join Date
    Aug 2009
    Posts
    38
    Plugin Contributions
    0

    Default Re: Hiding Categories

    Quote Originally Posted by Ajeh View Post
    I am afraid you have an error in your SELECT as you are also picking up the Top Level categories_id that have subcategories in them ...

    Is your intent to pick categories_id where there are active products "somewhere" within the branch or within the active products' active categories_id ...
    The idea was to pickup any categories that had an active product somewhere below. So the idea was to get to the top as it were. I hope I got hat correct.

    UNION queries are my favorite. When I see them I know the person has gotten deep into the guts of SQL. I never hire a DBA that cannot tell me where the Group By goes in a UNION query. So, if you know, don't write it here.

  3. #13
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Hiding Categories

    Has any one got the code for this? I really cant be bothered to work it out - It should be an option in zen cart anyway....

  4. #14
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Hiding Categories

    Has any one got the code for this?
    It is in post#11
    I really cant be bothered to work it out
    Then take it the way it is
    It should be an option in zen cart anyway....
    Can not be all things for all wants
    That is why it is open source
    Zen-Venom Get Bitten

  5. #15
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Hiding Categories

    I wasn't looking for philosophy, i will take that as you dont know...

  6. #16
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Hiding Categories

    i will take that as you dont know...
    post #11
    Zen-Venom Get Bitten

  7. #17
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Hiding Categories

    Basicallly I ran an sql code to disable any products which didnt have images and I am now finding empty categories on the menu. So it is pointless them being there. I dont want to do it manually as I process my data from a different database so a code to disable empty categories or just hide them on the menu is all i am looking for.

    It's a great idea for a menu mod or just as core code in zen cart.
    I can look into it if no one else has found the solution but i would prefer it if someone has already found out and is willing to contribute this information to the open source community of zen cart....

    It is quite difficult though i think because you are counting subcategory counts aswell and looking at multiple tables....

  8. #18
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Hiding Categories

    so a code to disable empty categories or just hide them on the menu is all i am looking for.
    My BAD it is Post #10 that has sql to return cats with active items and this can be used/altered to build upon
    Zen-Venom Get Bitten

  9. #19
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Hiding Categories

    Thanks I will take a closer look at that

  10. #20
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Hiding Categories

    I was thinking more like


    return $products_count;
    if ($products_count <=0){$query="update " . TABLE_CATEGORIES . " set categories_status =0 where categories_id = ".$products->fields['categories_id']."";
    $query = $db->Execute($query);}

    in the functions_categories.php to update the status to 0 based on category count althought this code doesnt work

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. hiding categories
    By ian healy in forum General Questions
    Replies: 2
    Last Post: 28 Apr 2008, 04:44 AM
  2. Hiding the top categories
    By maclancer in forum General Questions
    Replies: 0
    Last Post: 23 Jul 2007, 11:35 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