# onCheckoutPlusLinesChange: Checkout+ product added or removed

> STEP 3-2

```ts
onCheckoutPlusLinesChange?: () => void
```

Called after the SDK adds or removes the Checkout+ product: when it removes a leftover Checkout+ product (on the first cart fetch, or when [the previous screen is shown as is](./overview.html#glossary)), and when it adds or removes the product before checkout. Also called when the result could not be confirmed. Not called when your code changes the cart.

- Arguments: None. The cart contents are not passed.
- If you show cart lines or a cart total, always set this callback. The SDK adds and removes the Checkout+ product without going through your code, so unless you fetch the cart again, the cart lines and total on screen no longer match the actual cart. Inside it, fetch your cart state again.
- After fetching the cart for your UI again in this callback, you don't need to call `refresh()`. The SDK knows the cart it changed itself.

## When it throws

- How the SDK handles it: The SDK keeps running. It continues showing the banner and handling checkout, and reports `callback-failure` through `onError`.
- If it returns a Promise: The SDK does not wait for it to complete and does not receive a rejection. Handle failures of asynchronous work inside the callback.

```ts
onCheckoutPlusLinesChange: () => {
  // The SDK does not wait for the Promise, so handle failures of asynchronous work here
  reloadCart().catch((error) => reportError(error))
},
```
