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.
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:
-
On the menu bar, click Manage
. -
On the Manage page, click Schema.
-
On the Schema page, click M.PCM.Product.
-
On the M.PCM.Product details page, click Actions
> Enable/Disable. -
In the Enable/Disable dialog, turn on the Variants switch.
-
Click Done.
Add a Create product variant operation
To add a Create product variant operation:
-
On the menu bar, click Manage
. -
On the Manage page, click Pages.
-
On the Pages page, select Product details.
-
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.
-
Click Add operation and then click Create variant.
-
Click
, and select the Variant copy profile from the list. -
Fill in the remaining fields, as required.
-
Click Save and close.
Create a Detach product variant copy profile
To create a Detach product variant copy profile:
-
On the menu bar, click Manage
. -
On the Manage page, click Copy profiles.
-
On the Copy profiles page, click
Copy profile. -
Fill in the following fields:
Field name
Recommended value
Name
Detach product variant
Definition
M.PCM.Product
-
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" }
-
-
Click Save.
Create a Detach product variant operation
To create a Detach product variant operation:
-
On the menu bar, click Manage
. -
On the Manage page, click Pages.
-
On the Pages page, select Product details.
-
In the Product details pane, click the Entity operations component.
-
Click Add operation and then click Overwrite values.
-
Click
, and select the Detach Product variant copy profile from the list. -
Click Save and close.
Create a View variants operation
To create a View variants operation:
-
On the menu bar, click Manage
. -
On the Manage page, click Pages.
-
On the Pages page, select Product details.
-
In the Product details pane, click the Entity operations component.
-
Click Add operation and then click View detail page.
-
In the Link field, click
Add and select the Product variants check box. -
Click Save.