PrintAppClient class.
You can find a basic installation guide here.
This is how to initialize a PrintAppClient:
Parameters
Methods
Event types
Events are attached to thePrintAppClient after initialization using the addEventListener method.
Adding to the cart on save
With Add to Cart on Save turned on in a design’s settings, the client presses the store’s Add to Cart button for the customer after the project is saved. It waits for everyapp:saved listener to finish first, so the project can be attached to the cart line before the add.
A listener that does asynchronous work (posting the project to your server, say) must return its promise,
or the add can happen before that work is done:
printapp:addtocart event on document. Call preventDefault() and do the
add yourself:
Loading the editor without a designId
This feature allows you to initilize the editor without having an prior design, by describing a design template. The parameter to pass unto the editor is an object titleddesignTemplate
A sample value is shown in the code below with detailed comments.