---
title: "au-widget-cart/au-widget-cart | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/ui-framework/widgets/reference/au-widget-cart.au-widget-cart/"
---

# au-widget-cart/au-widget-cart

> 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.

## Classes

### AuWidgetCart

This widget can be used instead of the [Order widget](https://customerscanvas.com/dev/ui-framework/widgets/order.html).

For details, you can refer to the [Cart widget](https://customerscanvas.com/dev/ui-framework/widgets/cart.html) topic.

```json
{
  "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

```ts
new AuWidgetCart(): AuWidgetCart;
```

###### Returns

[`AuWidgetCart`](#auwidgetcart)

###### Inherited from

```ts
AuBaseInvisibleWidget.constructor
```

#### Properties

##### params

```ts
params: ICartConfig;
```

Properties of the widget.

###### Overrides

```ts
AuBaseInvisibleWidget.params
```

#### Accessors

##### template

###### Get Signature

```ts
get static template(): any;
```

###### Returns

`any`

###### Inherited from

```ts
AuBaseInvisibleWidget.template
```

#### Methods

##### checkInitDependenciesWidgets()

```ts
checkInitDependenciesWidgets(): string[];
```

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

###### Returns

`string`[]

###### Inherited from

```ts
AuBaseInvisibleWidget.checkInitDependenciesWidgets
```

##### resetPreloaderState()

```ts
resetPreloaderState(): void;
```

###### Returns

`void`

###### Inherited from

```ts
AuBaseInvisibleWidget.resetPreloaderState
```

##### showPreloader()

```ts
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

```ts
AuBaseInvisibleWidget.showPreloader
```

##### showToast()

```ts
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

```ts
AuBaseInvisibleWidget.showToast
```

## References

### widget

Renames and re-exports [AuWidgetCart](#auwidgetcart)
