Delete product types

To delete a product type, you must perform the following:

  1. Get an instance of the following managers:

    • Ecommerce manager
    • Metadata manager
    • Catalog definition manager
  2. Get the product type.
    For more information, see For developers: Query product types.
  3. Check if there are products associated with the product type.
    If there are products associated with the product type, you must first delete them.
    For more information, see For developers: Products.
  4. Remove the UI definition for the product type.
    To remove the product type from the catalog definition, call the RemoveProductTypeDefinition method of the catalog definition manager and pass the product type as an argument.
  5. Mark the product type for deletion.
    To do this, call the DeleteProduct method of the catalog manager and pass the ID of the product as an argument.
  6. Save the changes.
    To delete the product type, save the changes to the catalog manager.
  7. Adjust the catalog definition for a single product type.
    If after deleting the product type, there is only one created product type left, you must adjust the catalog definition for a single product type. To do this, call the AdjustForSingleProductType method of the catalog definition manager and pass the single product type as an argument.

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

Delete a product type




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?