Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
benadams  
#1 Posted : Friday, January 24, 2020 2:55:24 AM(UTC)
benadams

Rank: Advanced Member

Groups: Member
Joined: 3/20/2018(UTC)
Posts: 49

Thanks: 4 times
Hi everybody,
Hi Hope somebody can help me.

I have created a product and saved it with the save product method.
Now i want to load it as product. I did it well, my product can be loaded ....BUT it comes without any Configuration.

it's like he can read the configuration assigned in my code.

Here is my code used to load it


// Defining the editor configuration.
configuration = {
canvas: {
color: "grey"
},
grid: {
stepX: 0.5,
stepY: 0.5
},
initialMode: "Advanced",
customStyle: "mySiteStyles",
rendering: {
proofImageMockupEnabled: false
},
userInfo: {
"FirstName": "John",
"LastName": "Wood",
"Phone": "1234567890"
},
widgets: {
ObjectInspector: {
dndEnabled: false
}
},
tokenId: "95c16577-75fe-4145-87ff-c0ba49d1a554"
};

//Loading a product into the editor.

alert(userId);
// alert(config);
CustomersCanvas.IframeApi.loadEditor(
editorFrame[0],
stateId,
{userId: userId},
{configuration:configuration}
)
//

Thanks a lot

Edited by user Friday, January 24, 2020 2:56:29 AM(UTC)  | Reason: Not specified

VictorTolstov  
#2 Posted : Friday, January 24, 2020 3:20:13 AM(UTC)
VictorTolstov

Rank: Member

Groups: Member, Administration, Moderator
Joined: 11/14/2019(UTC)
Posts: 20

Was thanked: 1 time(s) in 1 post(s)
Hello Ben,

The fact is that the configuration is passed by the third parameter of loadEditor() method, and userId should be in the configuration, try using the sample of code that attached below

configuration = {
userId: userId,
canvas: {
color: "grey"
},
grid: {
stepX: 0.5,
stepY: 0.5
},
initialMode: "Advanced",
customStyle: "mySiteStyles",
rendering: {
proofImageMockupEnabled: false
},
userInfo: {
"FirstName": "John",
"LastName": "Wood",
"Phone": "1234567890"
},
widgets: {
ObjectInspector: {
dndEnabled: false
}
},
tokenId: "95c16577-75fe-4145-87ff-c0ba49d1a554"
};

CustomersCanvas.IframeApi.loadEditor(editorFrame[0],stateId,configuration)

Regards, Victor

Edited by user Friday, January 24, 2020 3:22:23 AM(UTC)  | Reason: Not specified

thanks 1 user thanked VictorTolstov for this useful post.
benadams on 1/27/2020(UTC)
benadams  
#3 Posted : Monday, January 27, 2020 11:34:27 AM(UTC)
benadams

Rank: Advanced Member

Groups: Member
Joined: 3/20/2018(UTC)
Posts: 49

Thanks: 4 times
Thanks a lot Victor,
that works fine.

Thanks
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.