silvershop / silvershop-core

SilverShop is an e-commerce shopping cart module for the SilverStripe CMS
http://silvershop.github.io
BSD 2-Clause "Simplified" License
113 stars 119 forks source link

canArchive on ProductCategory #803

Closed thomasbnielsen closed 5 months ago

thomasbnielsen commented 12 months ago

If you archive a ProductCategory, all products that are children of this ProductCategory, will also be archived. This is Silverstripe standard behaviour for pages, but it might not be transparent to the user, when working with products in multiple categories.

Example: The user has "Blue t-shirt" product in the category: "New T-shirts" but also the product has an additional category "Coloured T-shirts".

The user now deletes the category "New t-shirts", expecting the product to still exist in "Coloured T-shirts", but it does not, it is now archived.

wernerkrauss commented 12 months ago

A fix could be to disallow archiving for categories that contain products, this can be done via canArchive() method

wilr commented 5 months ago

Fixed in https://github.com/silvershop/silvershop-core/pull/817