Soft Delete and Variants

Vote:
 

In this older post for Commerce 13 Quan describes how to implement a "soft delete" convention for Catalog.

https://world.optimizely.com/forum/developer-forum/Commerce/Thread-Container/2018/7/products-hard-delete/

We used the same convention when we upgraded to Commerce 14. But since we upgraded to EpiServer.Commerce 14.21 our soft delete doesn't work correctly when viewing Products. The Variants tab doesn't display the variants of the Product and instead displays “There are no items available”.

We downgraded from 14.21 to 14.20 and the variants came back.

In a support ticket we were told with 14.21 this is expected behavior since this version introduced the "Archive" feature in Commerce.It was suggested we don't override the IsDeleted property in order for the Variants to show. However, this would break our soft-delete convention.

Can someone suggest how we can implement a soft-delete convention using 14.21 or higher?

#328541
Edited, Aug 30, 2024 16:31
Vote:
 

Hi,

I am not sure about the version that you upgraded and downgraded. You said that you upgraded from 13 to 14.21 and Soft Detete Convention is broken. When you downgraded from 14.21 to 14.20 then it works again? Or you downgraded from 14.21 to 13?

#328613
Sep 01, 2024 8:31
Vote:
 

When we downgraded from 14.21 to 14.20 then it works again.

#328707
Sep 03, 2024 13:22
Vote:
 

Unfortunately, I think it is best way to replacing your soft-delete convention by using new Archive feature. Because the new Archive feature from 14.21 and higher is same as soft-delete convention that you are doing. Using OOTB is also helpful for keeping your project to be able to continue to upgrade latest version with new OOTB features so far.

You can keep version 14.20 if you do want to fix your soft-delete convention in later version. But I think if you still have budget for that one then you can:

  • Replace your soft-delete convention code by new archive code
  • Migrate all data relates to soft-delete by Archive data
#328709
Sep 03, 2024 15:39
Vote:
 

I have to disagree. The Archive is like a trash bin where the intention is to delete the trash at some point in time, ~30 days. We have business rules that allow products and variants to be soft deleted and then brought back in the future for various reasons. Our PIM internal Ids associated to assets and items remain the same, which is why we want to keep a soft delete convention.

#328710
Sep 03, 2024 17:51
Vote:
 

Hi Mike,

The Archive is like to allow deletion temporary. If you do not want to clear trash bin automatically then you can turn off Archived Job interval

You also could change option for Archive threshold such as 90 days or longer as following:

services.Configure<CatalogOptions>(options => options.ArchivedThreshold = 90);
#328750
Edited, Sep 04, 2024 5:41
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.