---
title: "Variant configuration example"
slug: "variant-configuration-example"
abstract: "Example of configuring a variant."
---
# Variant configuration example

This example shows you how to configure a **Create variant** operation for products in Sitecore Content Hub. After you complete this walkthrough, the **Create product variant**, **Detach product variant**, and **View product variant** operations are available on the detail pages of *M.PCM.Product* entities.

> [!note]
> To configure the Variants feature, you must either be a superuser or have the necessary permissions granted to you through [user group policies](https://doc.sitecore.com/ch/en/users/content-hub/user-group-policies.html "User group policies").

## Enable variants on the product entity definition

To enable variants on the product entity definition:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Schema**.
3. On the **Schema** page, click *M.PCM.Product*.
4. On the *M.PCM.Product* details page, click **Actions** :mdiDotsHorizontal: > **Enable/Disable**.
5. In the **Enable/Disable** dialog, turn on the **Variants** switch.
6. Click **Done**.

## Add a Create product variant operation

To add a **Create product variant** operation:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Pages**.
3. On the **Pages** page, select **Product details**.
4. In the **Product details** pane, make sure that the [Custom settings enabled](https://content.stylelabs.cloud/api/public/content/db5884aaccc9421795bdb301629d16ba?v=b7017576) switch is turned on for the **Entity operations** component, and then click that component.
5. Click **Add operation** and then click **Create variant**.
6. Click :mdiPlus:, and select the *Variant* copy profile from the list.
7. Fill in the remaining fields, as required.
8. Click **Save and close**.

## Create a Detach product variant copy profile

To create a **Detach product variant** copy profile:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Copy profiles**.
3. On the **Copy profiles** page, click :mdiPlus: **Copy profile**.
4. Fill in the following fields:

    | Field name | Recommended value |
    | --- | --- |
    | **Name** | *Detach product variant* |
    | **Definition** | *M.PCM.Product* |

5. In the **Configuration** field, make sure the **Text** option is selected from the drop-down, and then update the following entries in the auto-generated copy profile.
    - in the **properties** node:

        ```csharp
        {
          "name": "M.PCM.Product.IsVariant",
          "method": "Overwrite",
          "value": false
        }
        ```

    - in the **relations** node:

        ```csharp
        {
          "name": "ProductToProductVariant",
          "method": "Remove"
        }
        ```

6. Click **Save**.

## Create a Detach product variant operation

To create a **Detach product variant** operation:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Pages**.
3. On the **Pages** page, select **Product details**.
4. In the **Product details** pane, click the **Entity operations** component.
5. Click **Add operation** and then click *Overwrite values*.
6. Click :mdiPlus:, and select the *Detach Product variant* copy profile from the list.
7. Click **Save and close**.

## Create a View variants operation

To create a **View variants** operation:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Pages**.
3. On the **Pages** page, select **Product details**.
4. In the **Product details** pane, click the **Entity operations** component.
5. Click **Add operation** and then click *View detail page*.
6. In the **Link** field, click :mdiPlus: Add and select the **Product variants** check box.
7. Click **Save**.