Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bulk order delete


ksolito

Recommended Posts

If you know SQL and phpmyadmin, it's pretty easy

eg:

DELETE FROM orders_total WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders_status_history WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders_products_attributes WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders_products WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders WHERE orders_id BETWEEN 100 AND 300;

 

Would do the first case - the date case is more tricky to do in SQL since the date_purchased is not a field on the order child tables and most mysql versions don't allow subqueries, which would make it easier. You could either do this in a code loop, or create a temporary table of order ids in your date range and join that to the child tables when deleting.

Link to comment
Share on other sites

If you know SQL and phpmyadmin, it's pretty easy

eg:

DELETE FROM orders_total WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders_status_history WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders_products_attributes WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders_products WHERE orders_id BETWEEN 100 AND 300;

DELETE FROM orders WHERE orders_id BETWEEN 100 AND 300;

 

Would do the first case - the date case is more tricky to do in SQL since the date_purchased is not a field on the order child tables and most mysql versions don't allow subqueries, which would make it easier. You could either do this in a code loop, or create a temporary table of order ids in your date range and join that to the child tables when deleting.

 

Thanks FalseDawn, while not the solution my customer is looking for, it suits me because he'll have to pay me to do it for him!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...