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:

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?