White paper: Templates in web-to-print.  Free download

setMockup Method

Callable

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

    example
    mockup = { 
        up: "envelopeMockup"
    }
    
    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("Failed to set up the mockup: ", error);
        });
    

    Parameters

    • mockup: IMockupTemplate

      A mockup to set.

    • Optional previewMockups: IMockupTemplate []

      A collection of preview mockups for proof images.

    • Optional options: object

      Additional configuration of mockups.

      • Optional updateRevertData: boolean

        Defines whether this mockup should be reverted or not when the user reverts product changes. If true, 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 surface.