saveProduct

Callable

  • Saves a product current state. See the Handling Product Customization topic for details.

    example
    // Saving a product.
    editor.saveProduct()
        // If the product is saved correctly.
        .then(function (result) {
            // Get the promise properties.
            userId = result.userId;
            stateId = result.stateId;
            returnToEditUrl = result.returnToEditUrl;
            console.log("User " + userId + " successfully saved state " + stateId);
        })
        // If there was an error thrown while saving the product.
        .catch(function (error) {
            console.error("Saving product failed with exception: ", error);
        });
    

    Returns Promise < ISaveProductResult >