Creating a batch Product Delete

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Hi Guys,

I havent done any serious web developing so looking for a little help.

My aim to create a batch product delete feature so i can delete loads of products at once.

....

I have started by going into the products.ascx.... gone to the products grid.

1) Added and ItemTemplate field.
2) Selected CheckBoxes
3) Named the header as "Delete"
4) Selected the part of the page I wanted and added a button
5) Named the button. BtnDeleteProducts.
6) Double clicked to add the event into the page.

Thats pretty much it - I think I need to create a stored procedure for deleting, call it to the button and give it selected checkbox numbers... i think....

Could anyone offer any help please?

Figure this would be useful for other people aswell.
14 anos atrás
There is a method in ProductManager called MarkProductAsDeleted() that sets the Deleted flag on the product row to true and sets all associated productVariant's deleted flags to true.

Did you want to actually remove the product records from the table?
14 anos atrás
Yeah I think permanent deletion would be best - unless it would cause problems to the store?
14 anos atrás
there is a good reason for not physically deleting the record from the DB. suppose you had a product that was sold on your site and is not available anymore or you dont carry anymore.
if you look at historical data and want to see the order details of one or more customers who bought it, if the product does not exist in the db anymore, you would have errors and alot of data inconsistencies.
14 anos atrás
I think he has 1000's of duplicate records due to a maligned import.

Let me look the table over. I think a SQL script that deletes dupes based on Product Name would be your best bet to clean up your database.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.