setMockups Method

Callable

  • Sets mockups for several product pages.

    example
    editor.getProduct()
        .then(function (product) {
            product.setMockups([
                {
                    surface: product.surfaces[0],
                    mockup: null
                }, {
                    surface: product.surfaces[1],
                    mockup: { up: "mockup1" }
                }, {
                    surface: product.surfaces[2],
                    mockup: { up: "mockup2" }
                }
            ])
            .then(function (product) {
                    console.log("Mockups are successfully set for the product " + product.id);
            });
        })
        .catch(function (error) {
            console.error("Setting up the mockups failed with exception: ", error);
        });
    

    Parameters

    • mockupsData: IMockupData []

      The product surface with mockups and preview mockups.

    • Optional options: object

      Mockup additional configuration.

      • Optional updateRevertData: boolean

        If true, then the new mockup is stored as one to restore when the product is reverted. Otherwise, the previously stored mockup is restored on a product revert. The default value is true.

    Returns Promise < Product >

    A new product instance containing the changed surfaces.