Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need the best way to delete a large category


Guest

Recommended Posts

Hi,

I need to delete a large category and all its products and description etc. Im guessing that a sql statement is the best way but not sure what since I know there is more then one table. All products start with the same 2 letter code depending on category so I know that is probably the key but that is about it. Any help would be appreicated!

Thanks,

Chris

Link to comment
Share on other sites

Nope I made that mistake once before. We are talking a couple thousand products. OSC craps out mid point and then I have a mess. Thats why I was looking for a sql statement.

 

 

 

Just go into admin->category, select the category and then click on the delete button.

 

Jack

Link to comment
Share on other sites

You have a mysql dump of the entire database with drop tables and complete inserts?

 

I'd get that, then edit the schema in a pro text editor and then redo the sql query replacing the entire db.

 

If it were me.

 

 

Which it has been a few times :)

 

 

 

 

 

 

Nope I made that mistake once before. We are talking a couple thousand products. OSC craps out mid point and then I have a mess. Thats why I was looking for a sql statement.

Link to comment
Share on other sites

if your server is dying halfway thru, then you have a server problem. the reason do to it via the admin area, is it takes care of all the 'rediduals' because a product does not go just into one table, it goes into many tables and your sql query may be wrong. and then you are even worse off.

Link to comment
Share on other sites

Nope I made that mistake once before. We are talking a couple thousand products. OSC craps out mid point and then I have a mess. Thats why I was looking for a sql statement.

 

I agree with Mibble. I had used the admin panel to delete categories with sub-categories 12 deep and hundreds and hundreds of products with no problem.

Link to comment
Share on other sites

Yeah that is what I thought until the first time I did it. But we are talking about a category that has about 2300 products with about 8 subs and each of those have about 3. Its proabably a matter of time out then anything else but once it stops then there is a mess left.

Cant risk that on a live store now.

 

I agree with Mibble. I had used the admin panel to delete categories with sub-categories 12 deep and hundreds and hundreds of products with no problem.

Link to comment
Share on other sites

Well server doesnt die actually. I think its more of a timeout on the page itself. But I agree on the many tables which is why I was asking about the correct query.

 

if your server is dying halfway thru, then you have a server problem.  the reason do to it via the admin area, is it takes care of all the 'rediduals' because a product does not go just into one table, it goes into many tables and your sql query may be wrong.  and then you are even worse off.

Link to comment
Share on other sites

Umm not sure if this will help or not, but what about setting up your shop on your local system (a copy of it) deleting out the categories and then uploading the changed db? (I don't know how well this would work for a live shop and it's just a thought off the top of my head after 10hrs studying so please excuse me if it's way off) :)

 

RW

 

Well server doesnt die actually. I think its more of a timeout on the page itself. But I agree on the many tables which is why I was asking about the correct query.

Link to comment
Share on other sites

Umm not sure if this will help or not, but what about setting up your shop on your local system (a copy of it) deleting out the categories and then uploading the changed db? (I don't know how well this would work for a live shop and it's just a thought off the top of my head after 10hrs studying so please excuse me if it's way off) :)

 

RW

 

Why don't you just make them all inactive for now until you decide what's best? Seems like all your concerned about is not letting customers purchase those products since you are live. A quick statement in phpmyadmin like this would do the trick:

 

UPDATE `products` SET `products_status` = '0' WHERE `products_model` = 'blah';

 

The thought here is you could disable products by model #. If model #'s don't work for you then replace the "stuff" after the WHERE with some other field that might be more appropriate...

 

Just a thought....

Link to comment
Share on other sites

You are right. The supplier is not reliable enough and rather lose the sales then deal with the customer service problems. That is a good idea for now since my model numbers are coded by supplier.

Thanks!

 

 

 

Why don't you just make them all inactive for now until you decide what's best? Seems like all your concerned about is not letting customers purchase those products since you are live. A quick statement in phpmyadmin like this would do the trick:

 

UPDATE `products` SET `products_status` = '0' WHERE `products_model` = 'blah';

 

The thought here is you could disable products by model #. If model #'s don't work for you then replace the "stuff" after the WHERE with some other field that might be more appropriate...

 

Just a thought....

Link to comment
Share on other sites

Not too bad of an idea, I'll have to think about that.

 

 

Umm not sure if this will help or not, but what about setting up your shop on your local system (a copy of it) deleting out the categories and then uploading the changed db? (I don't know how well this would work for a live shop and it's just a thought off the top of my head after 10hrs studying so please excuse me if it's way off) :)

 

RW

Link to comment
Share on other sites

If you are going to try my idea I would suggest installing the down for maintance contrib , then you can keep people from the store until you are done (should only take 30min or so (best guess)) That way your database doesn't get changed while you are working on it in the local server.

 

RW

 

However the other suggestion look better/easier to implement.

 

Not too bad of an idea, I'll have to think about that.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...