setMockup

Callable

  • Sets a new surface mockup. Returns new product instance containing the changed surface.

    example
    mockup = { 
        up: {
            mockupFile: "envelopeMockup", 
            previewMockupFiles: ["envelopePreviewMockup"]
        }
    }
    
    editor.getProduct()
        .then(function (product) {
            product.surfaces[0].setMockup(mockup)
                .then(function (product) {
                    console.log("Mockup is successfully set for product " + product.id);
                });
        })
        .catch(function (error) {
            console.error("Setting up a mockup failed with exception: ", error);
        });
    

    Parameters

    • mockup: IMockupTemplate

      A mockup to set.

    • 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 product revert. The default value is true.

    Returns Promise < Product >