Meet us at Drupa 24. Dusseldorf/Germany. May. 28 - Jun 7.
Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Moegal  
#1 Posted : Friday, October 7, 2016 12:59:55 PM(UTC)
Moegal

Rank: Member

Groups: Member
Joined: 3/5/2004(UTC)
Posts: 13

We would like to use the Load User Info Feature. But we want to use it on the fly. That is we want to click a button and have a popup form display that has the blank form fields for each field that my customer can fill in and the submit. Submitting it would fire the click event for the "Load My Info" button.

Any direction?
Marty

Julia Khoptyan  
#2 Posted : Monday, October 10, 2016 1:34:32 AM(UTC)
Julia Khoptyan

Rank: Advanced Member

Groups: Member
Joined: 8/19/2016(UTC)
Posts: 33

Was thanked: 1 time(s) in 1 post(s)
Moegal,

You can pass user data to the editor with loadUserInfo() method at runtime. Try the following:

1. Add some button that will create a popup form.

2. In the form call the loadUserInfo() method for Submit button when onclick event caused, e.g.:

Code:

...
// load web-to-print editor
CustomersCanvas.IframeApi.loadEditor(iframe, product, configuration)
.then(function (e) {
    // retrieve the loaded editor
    editor = e;
    $(#submitBtn).onclick = onUserInfoSubmit;
});
function onUserInfoSubmit() {
...
// populate a product with a user data
editor.loadUserInfo({ data: {"FirstName": "Jon", "LastName": "Snow", "Phone": "0123456789", "Email": "john.snow@mail.com"} })
...
};

Edited by user Wednesday, October 26, 2016 3:58:09 AM(UTC)  | Reason: Not specified

Moegal  
#3 Posted : Wednesday, October 12, 2016 7:29:55 AM(UTC)
Moegal

Rank: Member

Groups: Member
Joined: 3/5/2004(UTC)
Posts: 13

I will give it a try.

Seems easy enough.

Marty
Moegal  
#4 Posted : Monday, October 17, 2016 8:07:25 AM(UTC)
Moegal

Rank: Member

Groups: Member
Joined: 3/5/2004(UTC)
Posts: 13

Is there any way to read the fields on the psd design so I can create a form that matches the desired fields?

Marty
Julia Khoptyan  
#5 Posted : Tuesday, October 18, 2016 1:39:06 AM(UTC)
Julia Khoptyan

Rank: Advanced Member

Groups: Member
Joined: 8/19/2016(UTC)
Posts: 33

Was thanked: 1 time(s) in 1 post(s)
Yes, sure.

Use in-string and image placeholders to implement it.

Find more here: http://customerscanvas.c...user-data.htm#loadmyinfo (from sentense "The data to populate a product with should be loaded from your e-commerce system...")

Let me know if you need help with it.
Moegal  
#6 Posted : Tuesday, October 18, 2016 3:40:42 AM(UTC)
Moegal

Rank: Member

Groups: Member
Joined: 3/5/2004(UTC)
Posts: 13

Julia,

Actually I want to know if i can get a list of the actual placeholder names as json(or other) at run-time. For example: lets say i have two separate designs. Design "A" has placeholders FirstName, LastName, and Email. Design "B" has placeholders FullName, and Address.

I would like to show a form that only contains FirstName, LastName, and Email for design "A" and only display FullName, and Address for design "B".

Marty

Julia Khoptyan  
#7 Posted : Wednesday, October 19, 2016 10:54:56 PM(UTC)
Julia Khoptyan

Rank: Advanced Member

Groups: Member
Joined: 8/19/2016(UTC)
Posts: 33

Was thanked: 1 time(s) in 1 post(s)
Moegal,

We have prepared you a sample that shows how to get the product elements name. Find it attached.

I hope this will help you.

Julia

product-items.zip (2kb) downloaded 16 time(s).
Moegal  
#8 Posted : Monday, October 24, 2016 4:12:15 AM(UTC)
Moegal

Rank: Member

Groups: Member
Joined: 3/5/2004(UTC)
Posts: 13

I am getting an error when I try your code.

UpdateUserInfo failed

400 (Parameter data cannot be null)

and

/canvas/Resources/Export/simplePolygraphyScripts?v=KAqZ7xnMCpkR3r0JRBYd58KAjV3tjzM3MRfzQz2EKKc1:1:41



Originally Posted by: Julia Khoptyan Go to Quoted Post
Moegal,

You can pass user data to the editor with loadUserInfo() method at runtime. Try the following:

1. Add some button that will create a popup form.

2. In the form call the loadUserInfo() method for Submit button when onclick event caused, e.g.:

Code:

...
// load web-to-print editor
CustomersCanvas.IframeApi.loadEditor(iframe, product, configuration)
.then(function (e) {
    // retrieve the loaded editor
    editor = e;
    $(#submitBtn).onclick = onIserInfoSubmit;
});
function onUserInfoSubmit() {
...
// populate a product with a user data
editor.loadUserInfo({ data: {"FirstName": "Jon", "LastName": "Snow", "Phone": "0123456789", "Email": "john.snow@mail.com"} })
...
};


Julia Khoptyan  
#9 Posted : Thursday, October 27, 2016 1:58:17 AM(UTC)
Julia Khoptyan

Rank: Advanced Member

Groups: Member
Joined: 8/19/2016(UTC)
Posts: 33

Was thanked: 1 time(s) in 1 post(s)
Moegal,

Sorry for the delay.

See the attached example.

loadUserInfoExample.zip (3kb) downloaded 18 time(s).

-Julia.

Edited by user Thursday, October 27, 2016 1:58:54 AM(UTC)  | Reason: Not specified

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.