IVariable Interface

A structure representing a variable item in a product.

example
editor.getProduct()
    // If we have successfully obtained the product.
    .then(function (product) {
        return product.getVariableItems();
    })
    // If we have successfully obtained an item list.
    .then(function (items) {
        if (items.length)
            items.forEach(function (item) {
                console.log(item.name);
            });
        else
            console.log("This product contains no variable items.");
    });

Properties

name

name: string

The name of a variable item.

type

type: "Image" | "ImagePlaceholder" | "Text" | "InString" | "BarcodePlaceholder"

The type of a variable item.

Optional value

value: string

The value of a variable item. For texts, it is the content. For in-string placeholders, it is either entered text or default value. For barcodes, it is a string with the content.