Class AuWidgetCart
A widget that is used to initialize several products in your editor and receive several orders, either of which is bound to a separate product. This widget can be used instead of the Order widget.
For details, you can refer to the Cart widget topic.
{
"widgets": [
{
"name": "cart",
"type": "cart",
"params": {
"lineItems": [
{
"productIndex": 0,
"images": "{{ getOrDefault(\" $['editor'].proofImageUrls.map(item=>item[0])\",[]) }}",
"downloadUrls": "{{ getOrDefault(\" $['editor'].hiResUrls \",[]) }}",
"data": {
"stateId": "{{ getOrDefault(\" $['editor'].stateId \",'') }}",
"orderUrl": "{{ getOrDefault(\" settings.customersCanvasBaseUrl.toLowerCase().split('users')[0] + '/orders/DepositPhotos?userId=' + $['editor'].userId + '&stateId=' + $['editor'].stateId\",'') }}"
},
"props": { }
}
]
}
}
]
}
Package: ui-framework
Properties
params
Properties of the widget.
Declaration
params: ICartConfig
Property Value
Type | Description |
---|---|
ICartConfig | Properties of the widget. |
template
Declaration
static HTMLTemplateElement template
Property Value
Type | Description |
---|---|
HTMLTemplateElement |
Methods
checkInitDependenciesWidgets()
Returns an array of widget names, due to which the current widget cannot receive parameters.
Declaration
function checkInitDependenciesWidgets()
Returns
Type | Description |
---|---|
string[] |
resetPreloaderState()
Declaration
function resetPreloaderState()
showPreloader(boolean, string | string[], number)
Shows a preloader.
"onClick": [
"{{#function main.showPreloader(true, 'Creating print files...')}}",
"{{#function $['editor'].getHiResImages(800,800)}}",
"{{#function main.showPreloader(false)}}"
]
Declaration
function showPreloader(isPreload: boolean, message: string | string[], timeout: number)
Parameters
Type | Name | Description |
---|---|---|
boolean | isPreload |
If |
string | string[] | message |
A text message that appears next to the preloader. |
number | timeout |
showToast(string, number)
Shows a toast.
return editor.loadUserInfo(data)
.catch(err => {
this.widget.showToast("Error: Invalid data");
console.log(err);
});
Declaration
function showToast(data?: string, duration?: number)
Parameters
Type | Name | Description |
---|---|---|
string | data |
A string message to display in the toast. |
number | duration |
Defines how long to show the toast for. |