Page 1 of 2 12 LastLast
Results 1 to 10 of 32

Hybrid View

  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!]
    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!]
    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
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

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

    Quote Originally Posted by Ajeh View Post
    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;
          }
        } 
    I know this is a really really old thread LOL but I'd like to just hide the category counts on the top level categories but still show them on the subcats...what would I need to change in the above code to do that? Or how to make the category excluded there into an array instead I spose lol
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  8. #8
    Join Date
    Aug 2008
    Posts
    14
    Plugin Contributions
    0

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

    Hello,

    I am trying to find out how to turn off the category count for my products, Just the number that shows next to each product in the category box on the main page. I have set all quanity counts to (zero), But i must be missing one.

    I know there is a way to do this without having to do code, Just using the configuration some were?

    Thanks alot!

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

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

    Quote Originally Posted by Keith.S View Post
    Hello,

    I am trying to find out how to turn off the category count for my products, Just the number that shows next to each product in the category box on the main page. I have set all quanity counts to (zero), But i must be missing one.

    I know there is a way to do this without having to do code, Just using the configuration some were?

    Thanks alot!
    Admin > Configuration > my store

    Show Category Counts = False

  10. #10
    Join Date
    Mar 2006
    Posts
    477
    Plugin Contributions
    0

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

    How about doing this same thing but i only want to show the quanity in one category for our clearance section only
    We sell ATV, Dirtbike, Streetbike, Snowmobile, Watercraft & Custom stickers & Banners. Check us out www.AD-DiscountPerformance.com

 

 
Page 1 of 2 12 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

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