# ShoppingCart

# ShoppingCart

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/com/google/android/engage/shopping/datamodel/ShoppingCart "View this page in Java")  


```
class ShoppingCart
```

<br />

*** ** * ** ***

An object representing a Shopping Cart.

## Summary

|                                                                                                                                       ### Nested types                                                                                                                                       |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[ShoppingCart.Builder](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart.Builder) Builder class for [ShoppingCart](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart). |

|                                                                                                                                                           ### Public functions                                                                                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html)`!`                                                                                                                                                                                                                                                                    | [getActionLinkUri](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getActionLinkUri())`()` Returns the action link of the shopping cart.                                                                         |
| [Optional](https://guava.dev/releases/21.0/api/docs/com/google/common/base/Optional.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`!>!`                                                                                                                                                         | [getActionText](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getActionText())`()` Returns the action text of the shopping cart. e.g. "View Cart"                                                              |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                | [getClusterType](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getClusterType())`()`                                                                                                                           |
| `(`[Mutable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[DisplayTimeWindow](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/DisplayTimeWindow)`!>!` | [getDisplayTimeWindows](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getDisplayTimeWindows())`()` Returns the display time window associated with the shopping cart.                                          |
| `(`[Mutable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`!>!`                                                 | [getItemLabels](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getItemLabels())`()` Returns the labels of the items in the shopping cart                                                                        |
| [Optional](https://guava.dev/releases/21.0/api/docs/com/google/common/base/Optional.html)`<`[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`!>!`                                                                                                                                                             | [getLastUserInteractionTimestampMillis](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getLastUserInteractionTimestampMillis())`()` Returns the timestamp when the user last interacted with the shopping cart. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                | [getNumberOfItems](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getNumberOfItems())`()` Returns the number of items in the shopping cart.                                                                     |
| `(`[Mutable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[Image](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/Image)`!>!`                         | [getPosterImages](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getPosterImages())`()` Returns the poster images of the items in the shopping cart.                                                            |
| [Optional](https://guava.dev/releases/21.0/api/docs/com/google/common/base/Optional.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`!>!`                                                                                                                                                         | [getTitle](https://developer.android.com/reference/kotlin/com/google/android/engage/shopping/datamodel/ShoppingCart#getTitle())`()` Returns the title of the shopping cart.                                                                                               |

## Public functions

### getActionLinkUri

```
fun getActionLinkUri(): Uri!
```

Returns the action link of the shopping cart.  

### getActionText

```
fun getActionText(): Optional<String!>!
```

Returns the action text of the shopping cart. e.g. "View Cart"  

### getClusterType

```
fun getClusterType(): Int
```  

### getDisplayTimeWindows

```
fun getDisplayTimeWindows(): (Mutable)List<DisplayTimeWindow!>!
```

Returns the display time window associated with the shopping cart.

This can be used for several use cases like shopping cart expiry time window.  

### getItemLabels

```
fun getItemLabels(): (Mutable)List<String!>!
```

Returns the labels of the items in the shopping cart  

### getLastUserInteractionTimestampMillis

```
fun getLastUserInteractionTimestampMillis(): Optional<Long!>!
```

Returns the timestamp when the user last interacted with the shopping cart.  

### getNumberOfItems

```
fun getNumberOfItems(): Int
```

Returns the number of items in the shopping cart.  

### getPosterImages

```
fun getPosterImages(): (Mutable)List<Image!>!
```

Returns the poster images of the items in the shopping cart.  

### getTitle

```
fun getTitle(): Optional<String!>!
```

Returns the title of the shopping cart.