Skip to main content

au-widget-cart/au-widget-cart

Classes​

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": { }
}
]
}
}
]
}

Constructors​

Constructor​
new AuWidgetCart(): AuWidgetCart;
Returns​

AuWidgetCart

Inherited from​
AuBaseInvisibleWidget.constructor

Properties​

params​
params: ICartConfig;

Properties of the widget.

Overrides​
AuBaseInvisibleWidget.params

Accessors​

template​
Get Signature​
get static template(): any;
Returns​

any

Inherited from​
AuBaseInvisibleWidget.template

Methods​

checkInitDependenciesWidgets()​
checkInitDependenciesWidgets(): string[];

Returns an array of widget names, due to which the current widget cannot receive parameters.

Returns​

string[]

Inherited from​
AuBaseInvisibleWidget.checkInitDependenciesWidgets
resetPreloaderState()​
resetPreloaderState(): void;
Returns​

void

Inherited from​
AuBaseInvisibleWidget.resetPreloaderState
showPreloader()​
showPreloader(
isPreload,
message?,
timeout?): void;

Shows a preloader.

"onClick": [
"{{#function main.showPreloader(true, 'Creating print files...')}}",
"{{#function $['editor'].getHiResImages(800,800)}}",
"{{#function main.showPreloader(false)}}"
]
Parameters​
ParameterTypeDefault valueDescription
isPreloadbooleanundefinedIf true, enables the preloader.
messagestring | string[]...A text message that appears next to the preloader.
timeoutnumber5-
Returns​

void

Inherited from​
AuBaseInvisibleWidget.showPreloader
showToast()​
showToast(data?, duration?): void;

Shows a toast.

return editor.loadUserInfo(data)
.catch(err => {
this.widget.showToast("Error: Invalid data");
console.log(err);
});
Parameters​
ParameterTypeDescription
data?stringA string message to display in the toast.
duration?numberDefines how long to show the toast for.
Returns​

void

Inherited from​
AuBaseInvisibleWidget.showToast

References​

widget​

Renames and re-exports AuWidgetCart

Was this page helpful?