// Initialize a product with the "card.psd" template and a channel container.
const productDefinition = {
surfaces: [{
printAreas: [{
designFile: "card",
containers: [{
name: "foil",
type: "texture",
texture: "texture.jpg"
}]
}]
}]
};
// Load the editor.
CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition)
// If the editor has been successfully loaded.
.then(function (editor) {
// When we get the product.
editor.getProduct().then(function (product) {
// Get the fourth container.
product.currentSurface.printAreas[0].getContainers()[3]
// Update this container with new parameters.
.update({
name: "SilverTexture",
texture: "silver-texture.jpg",
// Expects a translated string for the SILVER key in translations.json.
translationKey: "ObjectInspector.SILVER"
});
});
});