Welcome to the support center for

Fancy Product Designer & Multistep Product Configurator

Answered

addElement doesn't work.

Hi All,


I am very new on fancy product designer. Firstly, I have tried to add a text and image to my designer.


In the sample Html, after the line of 


yourDesigner = new FancyProductDesigner($yourDesigner, pluginOpts);


I have added the line:


yourDesigner.addElement("image","images/designs/heart_circle.png","Test"); 


but I'm getting error


FancyProductDesigner-all.js:12604 Uncaught TypeError: Cannot read property 'addElement' of undefined

    at FancyProductDesigner.addElement (FancyProductDesigner-all.js:12604)

    at eval (eval at <anonymous> ((index):44), <anonymous>:1:14)

    at HTMLDocument.<anonymous> ((index):68)

    at c (jquery.min.js:3)

    at Object.fireWith [as resolveWith] (jquery.min.js:3)

    at Function.ready (jquery.min.js:3)

    at HTMLDocument.H (jquery.min.js:3)


Did I make any mistake or is there any issue related to addElement?


Thanks in advance


Answer

you need to wait for the designer to be ready.


$yourDesigner.on("productCreate", function(){
yourDesigner.addElement("image","images/designs/heart_circle.png","Test"); 
});


should work.


Login or Signup to post a comment