Forums / Setting Up Categories, Products, Attributes / Can not find or delete a specific product but it's there...

Can not find or delete a specific product but it's there...

Locked

Views: 1,449

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
19 Aug 2007, 1:56 PM
#1
thomasw98 avatar

thomasw98

Zen Follower

Join Date:
Aug 2007
Location:
Eugene, OR
Posts:
166
Plugin Contributions:
0

Can not find or delete a specific product but it's there...

Using version 1.3.7

I have a mystery product that is not located in any category file (or subcategory file), but it still appears when users click "All Products". It also appears as a possibility to add to "Featured Products" in admin. I know its product ID number, since I can read that on the product listing page (which I can reach when I display this product on the "Featured Products" list.

My guess is that I did not follow this warning: "Warning: Linked Products whose Master Categories ID are deleted will not price properly. You should first assure that when deleting a Category that contains Linked Products that you reset the Product(s) Master Categories ID to another Category before removing a Category"...in other words, maybe I did not reset the matser category for one product before I deleted its category? Not 100% sure if this is the reason, but that is my best guess.

So, what do I do now to really and truly delete this product? I suppose I could ignore it except for the fact that it appears when users click "All Products".

Any ideas?

Thanks!

19 Aug 2007, 2:27 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can not find or delete a specific product but it's there...

Safest would be to run the following SQL in Admin > Tools > Install SQL Patches> update products set products_status = 0 where products_id = n;However, if you haven't taken any orders for it, attached any attributed to it, added any specials to it, etc. You could instead do the more radical> delete from products where products_id = n;

delete from products_description where products_id = n;
delete from products_to_categories where products_id = n;Don't forget to substitute the product ID for n and as always, backup your database first.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

20 Aug 2007, 12:30 AM
#3
thomasw98 avatar

thomasw98

Zen Follower

Join Date:
Aug 2007
Location:
Eugene, OR
Posts:
166
Plugin Contributions:
0

Re: Can not find or delete a specific product but it's there...

kuroi:

Safest would be to run the following SQL in Admin > Tools > Install SQL PatchesHowever, if you haven't taken any orders for it, attached any attributed to it, added any specials to it, etc. You could instead do the more radicalDon't forget to substitute the product ID for n and as always, backup your database first.

I executed this one: "update products set products_status = 0 where products_id = n;" and it worked perfectly. Problem solved.

I am wondering if I should also execute the more "radical" commands now as well, in order to totally clean out all traces of this product. I have previously taken some test orders on this item. Or should I just leave well enough alone?

Thanks for you help,

Thomas

20 Aug 2007, 3:17 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can not find or delete a specific product but it's there...

The database schema shows the tables affected by different kinds of data. You may find it useful for reference:
http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema#Product_Info

.
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.

20 Aug 2007, 8:18 AM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can not find or delete a specific product but it's there...

I'm a bit anal on these things and personally would clean up the unwanted products to avoid confusion or problems later. But make sure that you have backed up your database and test the results carefully.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

20 Aug 2007, 9:11 AM
#6
thomasw98 avatar

thomasw98

Zen Follower

Join Date:
Aug 2007
Location:
Eugene, OR
Posts:
166
Plugin Contributions:
0

Re: Can not find or delete a specific product but it's there...

kuroi:

I'm a bit anal on these things and personally would clean up the unwanted products to avoid confusion or problems later. But make sure that you have backed up your database and test the results carefully.

I agree, but I was worried that since I already had taken orders for this product (when I was testing), the "radical" approach will cause me other problems. So I first went and deleted all the orders that I had previously received for this product. Then next, I executed your "radical" commands.

So far it seems that everything is all cleaned up.

Thanks again!:clap: