Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Disabled products show as new products after editing

    Hi all,

    before I attack the code, I had some items in my store that I have editted and then disabled. The edit makes Zen Cart thinks the products are new. Fair enough. But they show up in the New Products box even though they are disabled. Does this need a tweak or are there settings for this?

    Also, I have found that a category that has products in it, all of which are disabled, still shows in the category list. Again, does this need a tweak or is there a configuration setting?

    Thanks

    Kevin

  2. #2
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Disabled products show as new products

    To be clear, when I say need a tweak, I mean if I want to change the desired behavior. I am not trying to imply Zen Cart is at fault. I thik we all know Zen Cart is great - why else would we be on the forum in the first place!

    Kev

  3. #3
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Disabled products show as new products

    Yuu guys must be thinking I like talking to myself - I keep replying to myself!

    Well everyday, more things about Zen Cart click into place. Like the template system. it doesn't matter how well it's explained, once the penny drops it drops. I'm beginning to find my way around now.

    So....with regard to not displaying categories with no products. There is no option for this. And I see why. It's not that straight forward. To do this needs a slight change to

    /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_categories.php

    It's easy if you don't use sub categories. Will post if anyone wants it - but don't use it if you use sub-categories. I may have a go at making it sub-category compatible later.


    With regard to disabled products in the New Products box - I'm on it now, but if anyone knows do get back to me.

    Thanks again

    Kev

  4. #4
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Disabled products show as new products

    Found a silimlar thread for the Disabled Products/New Products bug.

    http://www.zen-cart.com/forum/showthread.php?t=82619

  5. #5
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Disabled products show as new products

    To hide categories with no products IF YOU DON'T USE sub-categories, mkae these code changes (and I suggest doing it in your template rather than changing original Zen files).

    File: /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_categories.php

    Around line 30 change:

    PHP Code:
    if (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 {
            
    $content .= '<a class="' $new_style '" href="' zen_href_link(FILENAME_DEFAULT$box_categories_array[$i]['path']) . '">'
    to:

    PHP Code:
    if (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 {
            if (
    $box_categories_array[$i]['count'] > 0) {

            
    $content .= '<a class="' $new_style '" href="' zen_href_link(FILENAME_DEFAULT$box_categories_array[$i]['path']) . '">'

    And around line 60 change:

    PHP Code:
    if (SHOW_COUNTS == 'true') {
              if ((
    CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
                  
    $content .= CATEGORIES_COUNT_PREFIX $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
              }
          }
          
    $content .= '<br />' "\n";
        }
      } 
    to:

    PHP Code:
    if (SHOW_COUNTS == 'true') {
              if ((
    CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
                  
    $content .= CATEGORIES_COUNT_PREFIX $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
              }
          }
          
    $content .= '<br />' "\n";
          } 
    // extra brace for if count > 0
        
    }
      } 
    Kev

  6. #6
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Disabled products show as new products

    Just to let you know I have tried the above fix with sub categories

    e.g.

    Cat 1
    |
    |- Sub Cat 2
    |
    |-Sub Cat 3 ( 1 product)
    |-Sub Cat 4


    Without the fix above you would see
    Cat 1 (1)
    |
    |- Sub Cat 2 (1)
    |
    |-Sub Cat 3 (1)
    |-Sub Cat 4

    With the fix abouve you see
    Cat 1 (1)
    |
    |- Sub Cat 2 (1)
    |
    |-Sub Cat 3 (1)

    So it works perfectly for sub-categories.

    Kev

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

    Default Re: Disabled products show as new products

    You may wish to read through and apply the Known Bug Fixes for v1.3.8 ...
    http://www.zen-cart.com/forum/showth...717#post659717
    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!

 

 

Similar Threads

  1. Stop Disabled Products From Showing in New Products for Category?
    By way10c in forum Customization from the Admin
    Replies: 10
    Last Post: 14 Mar 2011, 03:52 AM
  2. Disabled Products show up in New Products for (insert month)
    By LadyMorgana in forum Setting Up Specials and SaleMaker
    Replies: 33
    Last Post: 16 Feb 2010, 12:54 AM
  3. disabled products still show up in "What's new"
    By visionsfromvoid in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 18 Sep 2009, 06:24 PM
  4. NOT show disabled Products in New Products
    By Muzz in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 3 Jun 2009, 01:55 AM
  5. Products from disabled categories show up in New Products on home page.
    By peppyone in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 23 Jun 2008, 07:20 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