Variant configuration example

This example shows you how to configure a Create variant operation for Sitecore Product Content Management (PCM) products. 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.

Enable variants on the product entity definition

To enable variants on the product entity definition:

  1. On the menu bar, click Manage cog icon.

  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 more options icon > 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 cog icon.

  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 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 plus sign, 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 cog icon.

  2. On the Manage page, click Copy profiles.

  3. On the Copy profiles page, click plus sign 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:

      RequestResponse
      {
        "name": "M.PCM.Product.IsVariant",
        "method": "Overwrite",
        "value": false
      }
      
      
    • in the relations node:

      RequestResponse
      {
        "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 manage icon.

  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 plus sign, 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 cog icon.

  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 plus sign Add and select the Product variants check box.

  7. Click Save.

Do you have some feedback for us?

If you have suggestions for improving this article,