Skip to main content
Here, you will find all the parameters, events and methods on the 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 the PrintAppClient 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 every app: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:
If your cart needs something other than a button press, take the add over. Just before it presses the button, the client dispatches a cancelable printapp:addtocart event on document. Call preventDefault() and do the add yourself:
You can add this script to your store from the Custom JavaScript input in your store settings. If the client cannot find your Add to Cart button, set the Cart button selector in your store settings.

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 titled designTemplate A sample value is shown in the code below with detailed comments.