Deleting Category Deletes Product in ALL Categories?

Hi All

I have products in multiple categories. I deleted one category and it deleted ALL products in the categories, including products in OTHER categories. Is that right? Any way to recover that product info and reviews, etc without reverting to the last database backup?



Thank you



Janet

Hey There,



I've had this experience before as well. If you delete the upper-most (root) level category, then everything below it (sub categories) will be deleted as well. This is most likely not recoverable without performing a restore.



In the future, you most likely will want to delete your sub categories first and work your way up the category tree, instead of starting from the top! Sometimes you might not realize what products are nested inside sub categories until it's too late!

So you have something like this…



Category 1

Product A

Product B

Product C

Product D

Product E



Category 2

Product B

Product D



Category 3

Product A

Product E





You deleted Category 3, which deleted Product A completely, therefore it no longer appears in Category A - is this correct?



In this case, unfortunately the product has been deleted from the database and a database restore is your only option.



Why the software does this is beyond me…surely even a Warning pop-up notifying you the product(s) in the category will be deleted altogether from all categories would be better than nothing at all as it currently stands.



You could faff around with backing up now, restoring to before the deletes, exporting products, restoring back to the most recent backup then importing the deleted products. I guess it depends how much work you have done since the last backup you have.

Is this true? I can hardly believe this is the case… isn't it so that it deletes only products that are ONLY in the deleted category and not in another category? (which is still very stupid btw - product should simply stay in there no matter what)



See http://forum.cs-cart…elete-products/

[quote name='Flow' timestamp='1354221052' post='150128']

Is this true? I can hardly believe this is the case… isn't it so that it deletes only products that are in ONLY in the deleted category? (which is still very stupid btw - product should simply stay in there no matter what)

[/quote]

Considering a product MUST be assigned to a Category to either import or add a new product, it would be a fair assumption to make that if a product was only in one category and that category was deleted, the product would also be deleted.



I preferred how Interspire handled this - a further warning was displayed when deleting categories if it contained any products, if a product option group was deleted and currently assigned to one or more products. Better still, it lists the relevent products which will be affected by the deletion of the category or product option groups. Shame the rest of the software was poo pie.

Yes, Stellar Bytes that's how it worked. Oh well. Lesson learned. Thanks for the feedback.

I do think this need to be looked at.



Logic tell me if I delete a category I might not want to delete ANY products. The should be an option with 2 tick boxes next to each category - delete category[X] & delete products[X]



If you choose to delete only the category they either fall to root and have to be reasigned later or you are prompted to move them before the category is deleted.



Product maintainace is slow and unnatural in cs-cart - I'm finding this out to my cost today.

The product category field is mandatory and products cannot be set to the root level, so where would a product be moved to if the category was deleted? It's not something that can easily be rectified by CS-Cart, logically thinking if they were to add a default category ID #1 which is called Deleted Products, how many stores would have conflicts when upgrading to the new version with this functionality as they already have a category assigned to ID #1. How would this effect block content - as HTML block types tend to break if you edit the database table directly, it surely wouldn't be as simple as writing a single script to alter existing category ID's to account for this new default 'Deleted Products' category. It wouldn't be impossible, but it would be a rather major change to the core of the software as far as I can see, thus, other broken functions would be cast aside to allow development of the 'deleted category/product' function.

[quote name='StellarBytes' timestamp='1359156971' post='153689']

The product category field is mandatory and products cannot be set to the root level, so where would a product be moved to if the category was deleted?[/quote]



If you import a csv file (new products) via admin without assigning a category, a category named “Products” is created and that is where they are assigned. Maybe that should be implemented with the delete category function.?

I'm not an expert but only yesterday while trying to delete more then 2 products without the server timing out I managed to moved 150 products to the root. This was the only way I could delete them in one go.

[quote name='kickoff3pm' timestamp='1359194926' post='153701'] I'm not an expert but only yesterday while trying to delete more then 2 products without the server timing out I managed to moved 150 products to the root. This was the only way I could delete them in one go. [/quote]



How did you move the product to the root? I'm wondering what would happen if a second category was assigned to a product before deletion, would the product remain in the new category?

[quote name='merchantman' timestamp='1386447493' post='173154']

How did you move the product to the root? I'm wondering what would happen if a second category was assigned to a product before deletion, would the product remain in the new category?

[/quote]

You cannot move products to the 'root' as the 'root' category doesn't exist in the database schema. I assume therefore that kickoff3pm meant the a category at the top level of the tree.

Idiots logic.