You’re viewing outdated documentation. View the latest Customer’s Canvas On-Premises documentation.

setMockup Method

Applies to: Customer's Canvas On-Premises; Design Editor 4.4.25, 4.x (may differ) · Archived documentation

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("Setting up a mockup failed with exception: ", error);
        });

    Parameters

    • mockup: MockupTemplateTypes

      A mockup to set.

    • Optional options: object

      Mockup additional configuration.

      • Optional updateRevertData: boolean

        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.