Results 1 to 10 of 19

Hybrid View

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

    Default Re: how do mass delete all products from one manufacturer?

    This would be a bad idea as there are many tables involved with Products ...
    products
    products_description
    specials
    featured
    reviews
    etc. etc. etc.
    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!

  2. #2
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: how do mass delete all products from one manufacturer?

    Ajeh, please remove my previous post. :) Thanks.

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

    Default Re: how do mass delete all products from one manufacturer?

    Actually it is a good post to help people understand that there is more to a Product than just the products table and to not delete them in that manner or they will run into major issues ...
    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!

  4. #4
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: how do mass delete all products from one manufacturer?

    So how do you mass delete old products? Do you really have to delete one at a time?

    Furthermore, if you delete one by one, or possibly mass delete (let say 200 products); would the remaining record id's create a problem? When year after year you create newer and delete old products? Can the table be somehow compacted?
    Using Zen Cart 1.5.1

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: how do mass delete all products from one manufacturer?

    Quote Originally Posted by Kevin205 View Post
    So how do you mass delete old products? Do you really have to delete one at a time?

    Furthermore, if you delete one by one, or possibly mass delete (let say 200 products); would the remaining record id's create a problem? When year after year you create newer and delete old products? Can the table be somehow compacted?
    No need to "compact" anything... the ID is just an auto-increment and is a database's way of assigning a unique identifier to a record.


    If you use Easy Populate, you will see a column called v_status.

    There are THREE possible variables for this column:-

    1 = Product is active and visible
    0 = Product is inactive and hidden (such as when product is out of stock)
    9 = Delete product

    So if you create an Easy Populate spreadsheet of ONLY the products you want removed, and in the v_status column you put the digit - " 9 " against each product, then run that through easy populate - it will delete the products AND THEIR IMAGES...

    If you want to keep the images, then make a backup off the server.
    Last edited by schoolboy; 22 Jan 2013 at 03:58 PM.
    20 years a Zencart User

  6. #6
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    115
    Plugin Contributions
    0

    Default Re: how do mass delete all products from one manufacturer?

    You can delete product via Easy Populate by setting the v_status to "9". Any product with 9 invokes the "ep_remove_product" function which in turn uses "zen_remove_product" which wipes the product from all relevant tables and will also delete the associated images from your images folder (/admin/includes/functions/general.php around line 1359). I think that's the easiest option.

    The other alternative would be to write a PHP script that looks up all product IDs by manufacturer, loops through them & runs zen_remove_product on each ID. Basically always use zen_remove_product and you're fine.

    Hope this helps.

    PS oh schoolboy beat me to it by a few seconds :)

  7. #7
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: how do mass delete all products from one manufacturer?

    Quote Originally Posted by schoolboy View Post
    No need to "compact" anything... the ID is just an auto-increment and is a database's way of assigning a unique identifier to a record.


    If you use Easy Populate, you will see a column called v_status.

    There are THREE possible variables for this column:-

    1 = Product is active and visible
    0 = Product is inactive and hidden (such as when product is out of stock)
    9 = Delete product

    So if you create an Easy Populate spreadsheet of ONLY the products you want removed, and in the v_status column you put the digit - " 9 " against each product, then run that through easy populate - it will delete the products AND THEIR IMAGES...

    If you want to keep the images, then make a backup off the server.
    Quote Originally Posted by terraGirl View Post
    You can delete product via Easy Populate by setting the v_status to "9". Any product with 9 invokes the "ep_remove_product" function which in turn uses "zen_remove_product" which wipes the product from all relevant tables and will also delete the associated images from your images folder (/admin/includes/functions/general.php around line 1359). I think that's the easiest option.

    The other alternative would be to write a PHP script that looks up all product IDs by manufacturer, loops through them & runs zen_remove_product on each ID. Basically always use zen_remove_product and you're fine.

    Hope this helps.

    PS oh schoolboy beat me to it by a few seconds :)



    WOW, that's pretty cool, great. Thank you.
    Using Zen Cart 1.5.1

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: how do mass delete all products from one manufacturer?

    If you have not installed Easy Populate, you will need EP version 4. The earlier versions are not compatible with ZC 1.5.x
    20 years a Zencart User

 

 

Similar Threads

  1. v151 Mass unlink all Categories from one particular category
    By gilby in forum General Questions
    Replies: 10
    Last Post: 16 Nov 2014, 11:25 PM
  2. how to delete all catagories in one operation?
    By minshop.no in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 9 Aug 2009, 09:00 PM
  3. Delete All Products By Manufacturer
    By milobloom in forum General Questions
    Replies: 4
    Last Post: 16 Jan 2008, 01:28 AM
  4. copy attributes from a products to all products from a certain manufacturer?
    By dedj in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 5 Sep 2007, 03:12 PM
  5. One delete button to delete all checked items from cart
    By gsdcypher in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Jul 2007, 04:41 AM

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