Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32
  1. #1
    Join Date
    Oct 2007
    Posts
    4
    Plugin Contributions
    0

    Default Hide category count -- on only ONE category

    The store owner wants to hide the category count only for one category -- Gift Certificates. I know how to turn off the category count for ALL categories, but is there a way to do it for just one?

    This is the site in question: www.countrygiftsandmore.com

    Thanks!

  2. #2
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Hide category count -- on only ONE category

    This is possible with some PHP code. If you find the file that prints these categories, which should be categories.php under sideboxes, then you can put some PHP code in there that will not print if the category ID equals whatever gift certificates is.

    If you don't know PHP, then it can be tricky. I may be able to help you a little later. I'm setting up a new store but am not currently near the server/etc.

    I can try to get you a solution when I can. You still want a solution, right?

  3. #3
    Join Date
    Oct 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Hide category count -- on only ONE category

    I am still looking for a solution -- I'd warned the store owner that it might not be something easily done without coding.

    I don't have any experience with PHP, but I'm more than willing to learn what I can from you. Any tips or hints are more than welcome!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide category count -- on only ONE category

    You would need to customize the class for building the categories:
    /includes/classes/category_tree.php

    and customize the code to not add the count for that particular categories_id ... the code that adds the count is:
    PHP Code:
        if (SHOW_COUNTS == 'true') {
          
    $products_in_category zen_count_products_in_category($counter);
          if (
    $products_in_category 0) {
            
    $this->box_categories_array[$ii]['count'] = $products_in_category;
          } else {
            
    $this->box_categories_array[$ii]['count'] = 0;
          }
        } 
    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!

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide category count -- on only ONE category

    An example would be, if the Gift Certificates are in categories_id 21 then you could use:
    PHP Code:
        if (SHOW_COUNTS == 'true' && $counter != 21) {
          
    $products_in_category zen_count_products_in_category($counter);
          if (
    $products_in_category 0) {
            
    $this->box_categories_array[$ii]['count'] = $products_in_category;
          } else {
            
    $this->box_categories_array[$ii]['count'] = 0;
          }
        } 
    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!

  6. #6
    Join Date
    Oct 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Hide category count -- on only ONE category

    I'll try that -- thanks!!

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

    Default Re: Hide category count -- on only ONE category

    Can I disable my category count on my homepage only?

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide category count -- on only ONE category

    You can evaluate if you are on the Home page with the variable:
    $this_is_home_page

    PHP Code:
    if ($this_is_home_page) {
    // do this I am the home page
    } else {
    // do something else I am not the home page

    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!

  9. #9
    Join Date
    Aug 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Hide category count -- on only ONE category

    Perfect, I love using these kinds of commands on wordpress. If statements/ conditional statements to call or not call functions on specific pages.

    I tried to edit my category tree--but I did it wrong. The page of course did not load...

    Now, I undid my changes & the page still does not load--

    File Caching is not activated -- I checked for this.

    The admin panel continues to work fine...

    Is there something I can reset/ clear to get this functional again?

    I'll probably have to do it a few times in a row until I get the code alteration correct.

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

    Default Re: Hide category count -- on only ONE category

    hey--this is quite strange, but I restarted apache on the server & it's fine now (quite odd...)

    so I'll continue playing with this until I get it right :)

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. v151 Hide one category from category side box
    By robbie269 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Feb 2014, 03:35 PM
  2. ADD TO CART on Category Listing in One Category only
    By ald0413 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 Jan 2011, 07:05 PM
  3. Hide or Password Protect only one Category?
    By Boggled in forum Setting Up Categories, Products, Attributes
    Replies: 25
    Last Post: 1 Sep 2008, 12:42 PM
  4. Hide Price for only one category
    By microinfo in forum General Questions
    Replies: 2
    Last Post: 26 Jun 2008, 11:13 AM
  5. Only one product type in list; only in one category. Why?
    By whitefael in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 7 Jan 2007, 06:13 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