> For the complete documentation index, see [llms.txt](https://help.pixfizz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pixfizz.com/ecommerce/pixfizz-ecommerce/pixfizz-cms/liquid/forms/managing-saved-carts-with-liquid-forms.md).

# Managing Saved Carts with Liquid Forms

Three Liquid forms manage a customer's carts: `cart_clear`, `cart_unset`, and `cart_delete`. They look similar but keep different things, so choose based on what you want to preserve.

***

### The three forms

| Form          | What it does                                       | What is kept                                                                                                                       |
| ------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `cart_clear`  | Empties the current cart (removes all order lines) | The cart itself, including its promocode and selected address. The cart stays assigned to the session and remains in `user.carts`. |
| `cart_unset`  | Removes the current cart from the session          | Everything. The cart and its order lines are not deleted and remain accessible under `user.carts`.                                 |
| `cart_delete` | Permanently destroys a cart                        | Nothing. The cart and its order lines are removed.                                                                                 |

### How to use each form

#### Empty a cart but keep it (`cart_clear`)

Use when the customer wants to start over but stay in the same cart, keeping any applied promocode and address.

```liquid
{% form 'cart_clear' %}
	<button type="submit">Empty cart</button>
{% endform %}
```

#### Set the current cart aside (`cart_unset`)

Use to detach the current cart from the session without losing it. The customer can pick it up again later from their saved carts.

```liquid
{% form 'cart_unset' %}
	<button type="submit">Save for later</button>
{% endform %}
```

#### Delete a cart (`cart_delete`)

With no parameter, `cart_delete` deletes the current session cart. To delete a specific saved cart instead, pass it with the `cart:` parameter.

```liquid
{% comment %} Delete the current cart {% endcomment %}
{% form 'cart_delete' %}
	<button type="submit">Delete cart</button>
{% endform %}

{% comment %} Delete a specific saved cart {% endcomment %}
{% form 'cart_delete', cart: cart %}
	<button type="submit">Delete</button>
{% endform %}
```

### How it works

* `cart_delete` is asynchronous. After a successful delete, the cart can take a moment to disappear from `user.carts`, and the page does **not** redirect on its own. If you are building a saved-carts page, refresh or update the list after the delete completes so the removed cart stops showing.
* `cart_clear` leaves an empty cart in place, so the customer stays in the same cart with their promocode and address intact.
* `cart_unset` is the only non-destructive option: nothing is deleted, the cart is just removed from the active session.

### Related

* Liquid Forms (parent article)
* Address\_create Form Options
