Delete product variations

To delete a variation, you must perform the following:

  1. Get an instance of the catalog manager.
    Get an instance of the CatalogManager object.
  2. Get the variation detail for the specified variation.
    To get the variation detail, call the GetProductVariationDetails method of the manager and filter the collection by the ID of the variation. 
  3. Mark the variation detail for deletion.
    To mark the detail to be deleted, call the DeleteProductVariationDetail method of the manager and pass the ID of the detail as an argument.
  4. Mark the variation for deletion.
    To mark the variation to be deleted, call the DeleteProductVariation method of the manager and pass the ID of the variation as an argument.
  5. Save the changes.
    To delete the variation, save the changes to the manager.

NOTE: To delete multiple variations, query them and execute the code below for each one of them.

Use the following code sample:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?