au-widget-order/au-widget-order
Classes
AuWidgetOrder
A widget that is used to control the data that will be passed to the e-commerce driver when the user finishes editing data.
For details, you can refer to the Order widget topic.
{
"widgets": [
{
"name": "order-details",
"type": "order",
"params": {
"images": "{{$['editor'].proofImages}}",
"downloadUrls": "{{$['editor'].hiResUrls}}",
"data": {
"stateId": "{{$['editor'].stateId}}"
},
"props": {
"_hidden": {},
"_fields": {}
}
}
}
]
}
Constructors
Constructor
new AuWidgetOrder(): AuWidgetOrder;
Returns
Inherited from
AuBaseInvisibleWidget.constructor;
Properties
customPrice
customPrice: number;
The custom price for the order.
data
data: Object;
Custom data.
downloadUrls
downloadUrls: string[];
An array of the print-ready files.
images
images: string[];
An array of URLs to preview images.
logRequest
logRequest: boolean = false;
Send submit request to logging service if true (shopify-only)
params
params: IOrderConfig;
Properties of the widget.
Overrides
AuBaseInvisibleWidget.params;
props
props: Object;
Custom properties. They don't appear in the order, but are available in the onSubmitting callback.
quantity
quantity: number;
The number of ordered products.
sku
sku: string = "";
useBackOffice
useBackOffice: boolean = false;
Flag indicates if driver should perform some backOffice actions
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
| Parameter | Type | Default value | Description |
|---|---|---|---|
isPreload | boolean | undefined | If true, enables the preloader. |
message | string | string[] | ... | A text message that appears next to the preloader. |
timeout | number | 5 | - |
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
| Parameter | Type | Description |
|---|---|---|
data? | string | A string message to display in the toast. |
duration? | number | Defines how long to show the toast for. |
Returns
void
Inherited from
AuBaseInvisibleWidget.showToast;
References
widget
Renames and re-exports AuWidgetOrder