Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Posts
    254
    Plugin Contributions
    0

    red flag Change All Product Status

    Hi,

    I have a weird situation where 'out of stock and disabled' products are displayed in search and when browsing through categories, but when I click on them it doesn't give the product description or show you product image, since the product is disabled.

    I changed the "Products status in Catalog when out of stock should be set to" option to 1, so that should take care of any future problems.

    However, is there any SQL command to set ALL product status to 1. Then another SQL command to set all products directly under a disabled category back to 0? I wouldn't want them to appear in searches.

    (ZC version 1.5)

    Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Change All Product Status

    How many "disabled categories" do you have, and why?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Oct 2008
    Posts
    254
    Plugin Contributions
    0

    Default Re: Change All Product Status

    There's probably around 20ish categories throughout that I have disabled. They're disabled because I use a script to automatically import supplier datafeeds and can't have certain products listed on my site for legal reasons (i.e. weapons that the payment processors do not want sold).

    I guess I can go through and do it manually, I just wasn't sure if there was a quick one-liner SQL statement to de-activate products in de-activated categories that someone smart could write out for me :)

    Thanks

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Change All Product Status

    There's a quick one-liner to enable all products:
    update products set products_status = 1;

    or use 0 to disable them all.

    It gets more complicated when you want to start involving certain categories, especially if you have products linked to multiple categories.

    But you could do the category part by hand: enable the category from the admin, and then disable it again and say yes when it asks if you want to also disable all the products within it.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v154 Change Email Subject of Status Update Messages To Show Assigned Status
    By ShopVille in forum Managing Customers and Orders
    Replies: 12
    Last Post: 27 Oct 2015, 02:43 PM
  2. Replies: 0
    Last Post: 16 Mar 2015, 09:46 AM
  3. Change all orders from status 'x', to status 'y'.
    By bi11i in forum Customization from the Admin
    Replies: 3
    Last Post: 22 Jul 2011, 06:49 AM
  4. Change status of all products to enabled quickly, how?
    By coolglobal in forum General Questions
    Replies: 2
    Last Post: 7 Mar 2009, 11:30 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