Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2008
    Posts
    49
    Plugin Contributions
    0

    Default How To Delete Products with SQL? action=delete_product function?

    I'm looking for a way to delete products based on product_id's. I tried to look for the function in admin to do it, but I don't see it. Am I correct to assume I just go through each of the product tables and delete any row with the product_id I want to nuke?

    THanks

    Josh

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

    Default Re: How To Delete Products with SQL? action=delete_product function?

    There are lots of peices and parts related to deleting a product ...

    It would be better to do a search for the product and delete it in your Zen Cart Admin ...
    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!

  3. #3
    Join Date
    Jan 2008
    Posts
    49
    Plugin Contributions
    0

    Default Re: How To Delete Products with SQL? action=delete_product function?

    I've been using the Zencart URL to delete Product ID's and copying and pasting that, but I have several hundred items to nuke. Is the delete_product function available as an include maybe?

    I want to write a php script to delete all items with x in their description. This deleting part is giving me fits.

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

    Default Re: How To Delete Products with SQL? action=delete_product function?

    You could take the Delete Product proceedure and write your own criteria to manage this ...

    You should back up your database before attempting to do this ...

    If you look at how a Category is deleted and all of its Products, this should give you am idea of how to delete large quantities of Products based on a given condition ...
    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
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: How To Delete Products with SQL? action=delete_product function?

    Ajeh is right ... it's safer to use a built-in delete function.

    You could write your own script to use zen_remove_product($product_id) on all the products you need to nuke.
    .

    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.

  6. #6
    Join Date
    Jan 2008
    Posts
    49
    Plugin Contributions
    0

    Default Re: How To Delete Products with SQL? action=delete_product function?

    What do I need to include to use that function?

    I think this is the solution I'm looking for. No need to reinvent the wheel.

    Josh

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

    Default Re: How To Delete Products with SQL? action=delete_product function?

    the application_top.php ... You can see it loaded in most of the /admin files.
    .

    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. v139h Modify function to NOT delete image on product delete
    By JohnBoyCR in forum General Questions
    Replies: 5
    Last Post: 7 Jun 2012, 06:00 PM
  2. Can't delete products in cart with delete button
    By DaveS in forum General Questions
    Replies: 4
    Last Post: 20 Sep 2009, 09:54 PM
  3. how to delete a sql patch of a mod?
    By giuly in forum Contribution-Writing Guidelines
    Replies: 7
    Last Post: 25 May 2009, 01:12 PM
  4. delete / remove all products from a brand. SQL help
    By kitcorsa in forum General Questions
    Replies: 2
    Last Post: 20 May 2009, 03:30 PM
  5. SQL Query to Delete All Products Only
    By toussi in forum General Questions
    Replies: 0
    Last Post: 26 Nov 2008, 06:57 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