Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem removing/deleting Products/Orders


Guest

Recommended Posts

Hello everyone. I just noticed that when I delete entire categories, for example, the products are NOT deleted from the database. While they are NOT accessible any longer from the admin section, they are still in the database, and, when someone searches for them in the Store, they come up.

 

Try it:

 

http://www.unlimitedperfumes.com/advanced_...sterling+silver

 

 

As you can see, all those sterling silver jewelry items still come up, despite the fact that they were all supposedly deleted from the admin section. I see when I go into the database, that they are still there.

 

Is there a fix for this type of bug?

 

JP

Link to comment
Share on other sites

Um, delete the products first? A product can belong to multiple categories. You are warned when deleting a category that it contains products. The stock osC does not provide a feature of deleting products when their containing category is deleted.

 

You can certainly delete them from the database using phpmyadmin, etc.

Link to comment
Share on other sites

The problem is that each of those categories has THOUSANDS of products. Is there a way, once the category is deleted, to delete all the products?

 

JP

Link to comment
Share on other sites

I'm sure there's an SQL query that would do it, but it involves data from two tables so it would take a while for me to figure it out. The correlation of categories to products is in table products_to_categories. I'm uncertain if deleting the category deletes all the corresponding records in that table. If so, then you have to come up with a query that identifies all the products that are orphans.

Link to comment
Share on other sites

I know nothing about programming or MYSql so you will forgive me but, I did figure out that deleting an entire category deletes ALL corresponding entries in the products_to_categories table. Having said that, is there any way that you could help me put something together that, I suppose, will delete all records in the OTHER product tables, for which there isn't a row in the products_to_categories table?

 

Any help would be GREATLY appreciated.

 

JP

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...