Query product variations

Query a variation of a product by a property

To query a single variation, you must perform the following:

  1. Get an instance of the catalog manager.
    Get an instance of the CatalogManager object.
  2. Get the specified variation.
    To get the specified variation, you must either call the GetProductVariation method of the manager and pass the ID of the variation as an argument, or call the GetProductVariations method and filter the collection by one of the properties of the variation (e.g. Sku).

Use the following code samples to query a single variation by ID and by SKU:

Query variation by ID

Query variation by SKU

Query the variations of a product by the ID of the product

To query variations by a specified product, you must perform the following:

  1. Get an instance of the catalog manager.
    Get an instance of the CatalogManager object.
  2. Get the variations.
    To get the variations, you must call the GetProductVariations method and pass the ID of the product as an argument.

Use the following code sample:

Query all variations

To query all variations, you must perform the following:

  1. Get an instance of the catalog manager.
    Get an instance of the CatalogManager object.
  2. Get the variations.
    To get the variations, you must call the GetProductVariations method.

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?