---
title: "Action remove_from_cart"
description: "Removes an item from the cart by model and ID and recalculates totals."
---

# Action `remove_from_cart`

> **System ID:** `action_remove_from_cart`

## Description

Finds the first cart line with the same `item_model` and `item_id` (values from constants by paths), removes it, and updates `total`. Uses the same cart structure as `add_to_cart`.

## Events (scenario branches)

| Event | When it occurs |
|-------|----------------|
| **success** | Item removed (or cart updated) |
| **error** | No `item_model` or `item_id` in constants |

## Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `item_model` | string | yes | — | Path to the model in constants |
| `item_id` | string | yes | — | Path to the ID in constants |
| `save_to` | string | no | `cart` | Cart constant name |

## Configuration example

```json
{
  "item_model": "product.model",
  "item_id": "product.id",
  "save_to": "cart"
}
```

## Related docs

- [Actions reference](/en/actionjail/reference/actions-reference.md)
