Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Aug 2008
    Posts
    105
    Plugin Contributions
    0

    Default Automatic or sql to turn off subcategories and sub-subcategories with 0 active items

    Hello
    I was wondering if there is an automatic way to make subcategories and sub-subcategories with 0 active items to automatically turn off. Or if there is a SQL that would work for this.
    Our site has fabric that is link into many subcategories and once it is sold out, I have to manually go in and toggle or delete the sub and sub-subcategories. It would be nice to be able to do this automatically.
    Thanks for any help! Still loving ZenCart!
    Mona
    http://www.QuiltsInMontana.com

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    configuration->Layout_settings->Categories with 0 Products Status = 0

    At least that is what I think you coud be looking for.

    Cheers
    RodG

  3. #3
    Join Date
    Aug 2008
    Posts
    105
    Plugin Contributions
    0

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    Thanks RodG for the reply .... my configuration IS set up like that (Categories with 0 Products Status = 0 ) however, it does not toggle the sub nor sub subcategories to off.

    Any other ideas?
    Mona
    http://www.QuiltsInMontana.com

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    Quote Originally Posted by stxmona View Post
    Any other ideas?
    Mona
    http://www.QuiltsInMontana.com
    Sorry, no I don't.

    Hopefully someone else with have some idea.

    Cheers
    RodG

  5. #5
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    You may be able to add an observer (to listen for stock decrements)... Then do a SQL query to see if all products in the category are disabled (or have a quantity of 0)... Then disable the category if needed (and check the parent categories recursively). Not the most efficient, but might provide a starting place.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

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

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    I have code to make this happen that I built into an upcoming future release ... https://github.com/zencart/zencart/pull/231/files

    Let me get it translated for v1.5.4 and maybe from that you can address it for your v1.5.3 ... how hard can it be?
    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!

  7. #7
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    Quote Originally Posted by Ajeh View Post
    how hard can it be?
    Not very ... with YOU on the case!!
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    Quote Originally Posted by Ajeh View Post
    how hard can it be?
    <2 years later>
    "Almost got it".....

    Cheers
    RodG :)

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

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    Bzzzz ... times up!

    These are the changes needed for v1.5.4 to make the Empty Categories or Categories with just Products with status set off to not show ...

    Add via the Tools ... Install SQL Patches ...
    Code:
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Categories with Inactive Products Status', 'CATEGORIES_PRODUCTS_INACTIVE_HIDE', '0', 'Hide Categories with Inactive Products?<br />0= off<br />1= on', 19, 30, 'zen_cfg_select_option(array(\'0\', \'1\'), ', now());
    that will be in the Configuration ... Layout Settings ...
    Attached Files Attached Files
    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!

  10. #10
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Automatic or sql to turn off subcategories and sub-subcategories with 0 active it

    Quote Originally Posted by Ajeh View Post
    Bzzzz ... times up!
    Can anyone say "over achiever". <grin>

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Images for Categories, Subcategories and Sub-Subcategories.
    By shannonphx in forum Customization from the Admin
    Replies: 5
    Last Post: 16 Aug 2013, 08:59 PM
  2. Replies: 8
    Last Post: 9 Jul 2013, 02:53 AM
  3. Is it possible to turn off subcategories while I'm building them?
    By strugglingnovice in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Aug 2012, 07:04 PM
  4. Ad Subcategories into sub-subcategories
    By ellenspsp in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 21 Oct 2007, 06:06 PM
  5. Subcategories & sub-subcategories page links are stacking
    By METOOTECH in forum General Questions
    Replies: 2
    Last Post: 16 May 2007, 03:35 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