Hi to all,
after navigating to the WWStore admin module page and added some categories and products, i have noticed the following cases:
case 1: When a category has never been assigned child products, it can be deleted without problem.
case 2: When a category is assigned one or more child products, it cannot be deleted due to the Foreign Key constraint between tables Categories and Products and throws an exception. This makes complete sense, but the error message is really scary and in no case informative. The only way to figure out what happened is to debug the source code and search the database. Is there any way of providing a more descriptive error message?
case3: When deleting all the child products of a category, the category still cannot be deleted due to the same Foreign Key constraint and the same error message is displayed (case 2). When deleting a product, it is not physically deleted from the database, rather the column IsDeleted is set to true. This functionality is used, because the product could be inside an order, so the product information should exist, even if it is declared as deleted. But, why is the category not able to be deleted, since (in a logical level) it has no products assigned. I am not an SQL expert but, could a possible solution be for the Foreign key constraint to be in use only when the products are active (not logically deleted)?