Back to Website
Show / Hide Table of Contents

Variant selector

  • Last updated on December 29, 2023
  • •
  • 1 minute to read

The variant-selector widget shows product variants with designs and allows you to select one of them for personalizing.

{
    "name": "product-variants",
    "type": "variant-selector",
    "params": {...}
}

This is an initial widget embedded in a separate step in the mainPanel. After the user selects one of the variants, its data can be obtained in the selectedVariant property.

The variant selector widget requires a separate step.

Defining parameters

This widget uses a product ID, a product version ID, and a product filter ID (a link) to show product variants and designs.

When you create a widget to display variants for an e-commerce product, you can define variables in your workflow using the {||} syntax. In this case, the value enclosed in brackets will be processed by the BackOffice API, and it will receive the data of the product linked to the e-commerce product via the product link.

{
    "vars": {
        "pimProductId": "{| Product.id |}",
        "pimProductVersionId": "{| Product.productVersionId |}",
        "pimProductFilterId": "{| Product.productFilterId |}"
    },

    "widgets": [
        {
            "name": "variant-selector",
            "type": "variant-selector",
            "params": {
                "productId": "{{ vars.pimProductId }}",
                "productVersionId": "{{ vars.pimProductVersionId }}",
                "productFilterId": "{{ vars.pimProductFilterId }}"
            }
        }
    ]
}

When you don't use linked e-commerce products, then you can pass your product params to variant-selector through the attributes.

Params

Name Type Description Default value
productId number|string Product ID defined in BackOffice
productVersionId number|string (Optional). Product version undefined
productFilterId number|string (Optional). Product link ID undefined
onDoubleClick function (Optional). A function or array of functions that will be executed when an item is double-clicked null
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback