Readonly
BatchThe batch object allows to control elements related to batch operations including the records and the mapping.
Readonly
DataThe data object gives access to the data stored against the job itself.
Readonly
FieldsThe fields object gives access to the fields of the job including field management functions like adding, removing or editing fields.
Readonly
GlobalThe global object allows to control elements related to the global settings of the job. This includes the canvas, stock or output type as well as dynamic canvas sizes if enabled.
Readonly
PagesThe pages object gives access to the pages of the job including page management functions like adding, removing or editing pages.
Adds the current job to the basket as a clone, but keeps the editor and the job open. This is useful if you want to allow the user to continue editing the job after adding it to the cart.
Once the clone has been added, the optional callback will be triggered with information about the result.
The callback function that will be triggered once the process has finished. Check the parameter about success, warnings and the job id of the clone.
Adds the current job to the basket. If the item is already in the cart it will simply be saved. This will make any changes made to the job permanent. The editor will unload once the job has been saved and the item has been added to cart. The script will stop executing shortly after this call. If the job was previously saved as a project it will be removed, as a job can be only in one place at a time - either cart or saved project.
This will return the current global text direction of the editor.
The text direction of the editor.
This function helps to retrieve the current price of the product to use within the scripting context. The price will be automatically calculated based on the product configuration, number of pages and global configuration, quantity and attributes as well as optional media costs.
Optional
callback: ((number) => void)The callback to return the price. The price will be passed as a parameter to the callback function. Can be null to use the non-callback version.
Optional
unitPriceOnly: booleanFlag to control if the price should be the unit price or the total price based on the quantity.
Optional
skipFormat: booleanFlag to control if the price should be formatted or not. If true, the price will be returned as a number. If false, the price will be returned as a formatted string.
The final price.
Resets the current job to the default state. This will clear any custom adjustments made to the job. Including pages added, layouts selected, fields added or edited, etc. The editor will reload after the reset has been initiated, meaning that the script will stop executing shortly after this call.
This function can be used in a non-embedded context to save the job. It will only work in a non-embedded context. Note: for normal operations, add to cart and saved project should be used. Save should only be used for internal purposes.
Optional
callback: (() => void)The callback will be called once the save has finished. Check the parameter about success, to control if the save was successful. If the context is incorrect, it will not trigger the callback.
Saves the current setup as the product default. The product default is the clean template version of the current job. This means all content will be removed (text/images/etc). This function can only be called in an administration context. If the product is currently in use (aka has been ordered already) this function will trigger a confirmation dialog to warn the user that the product is in use and that the product default will not be used by existing orders.
Optional
callback: (() => void)The callback will be triggered if the default product has been saved correctly. It will not be triggered if it couldn't be saved or if the user cancelled the confirmation dialog.
This function saves the current job as a project. This will then unload the editor and load the saved project list. If the job was previously added to the cart it will be removed, as a job can be only in one place at a time - either cart or saved project.
Optional
callback: (() => void)'The callback will be called once it has been saved. Note that the editor will unload after the save has been initiated, meaning that the script will stop executing shortly after this call.
This function can be used in an embedded context to save the job. It will only work in an embedded context when the editor is embedded in a 3rd party application. E.g. in our external store plugins for Shopify and Magento.
Optional
callback: ((success) => void)The callback will be called once the save has finished. Check the parameter about success, to control if the save was successful. If the context is incorrect, it will not trigger the callback.
Sets the new global text direction of the editor.
The new text direction of the editor.
Sets the custom name of the job. The custom name is stored against the basket item and later against the order line item and can be used by the user to identify and label the job. The custom name is also available in other areas of the system like invoices and MIS connections.
The custom name to set. Maximum lengths is 254 characters. Can be an empty string.
The callback function that will be triggered once the process has finished. Check the parameter about success, to control if the custom name could be set.
Sets a product attribute specified by name with the given value. If the product attribute does not exist it will create it on the fly and add it to the product. This is the only situation where the optional parameter createHidden is relevant.
The product attribute value will not be validated. It is the responsibility of the code to provide a valid value. For enumerated values (dropdown, radio buttons, etc), the value must be the id of the option.
The name of the product attribute to set. If the product attribute does not exist it will be created on the fly and added to the product.
The new value to set. The value will not be validated.
Optional
callback: (() => void)The callback will be triggered once the process has finished. Check the parameter about success, to control if the product attribute could be set. Note that the calls to set product attributes are debounced in case of many subsequent calls, only a single AJAX call will be triggered.
Optional
createHidden: booleanBoolean flag to control if the new attribute should be created hidden or as an info type attribute. This only applies if the attribute does not exist yet.
Sets multiple product attributes at once. This is a convenience function to set multiple attributes at once. See SetProductAttribute for more details.
A dictionary of attributes to set. The key is the attribute name, the value is the attribute value. The value will not be validated. Unknown attributes will be created on the fly and added to the product.
Optional
callback: (() => void)The callback will be triggered once the process has finished. Check the parameter about success, to control if the product attributes could be set. Note that the calls to set product attributes are debounced in case of many subsequent calls, only a single AJAX call will be triggered.
Optional
createHidden: booleanBoolean flag to control if the new attribute should be created hidden or as an info type attribute. This only applies if the attribute does not exist yet.
Sets the job quantity. This will be stored against the basket item and later against the order line item. If the job has been ordered already, this function will fail and return false. Setting the quantity will also update the price if displayed in the editor and will log price script messages
The new quantity to set. Must be a positive number. Note: the code will not validate if the quantity is valid (e.g. pack quantity, quantity tiers etc). The code is responsible to provide a valid quantity value.
The callback will be triggered once the process has finished. Check the parameter about success, to control if the quantity could be set.
Generated using TypeDoc
The document handler defines functions and properties that allow to control the current job/document.