# Cart Totals

> CartTotalsList and total atoms for cart and order summary totals.

<!-- Sources: src/Components/Woo/CartTotals/CartTotalsList.php; src/Components/Woo/CartTotals/TotalsSubtotal.php; src/Components/Woo/CartTotals/TotalsDiscount.php; src/Components/Woo/CartTotals/TotalsShipping.php; src/Components/Woo/CartTotals/TotalsTax.php; src/Components/Woo/CartTotals/TotalsTotal.php; src/Components/Woo/Shared/CartTotalProperties.php; src/Components/Woo/Shared/TotalsListProperties.php; client/src/domains/woo/components/cart-totals.ts; src/Testing/E2E/Woo/WooScenarioProvider.php; tests/e2e/components/woo/behavior.spec.ts; tests/e2e/components/woo/lifecycle.spec.ts -->

# Cart Totals

This family renders cart total fields from `cartTotals` and live Store API cart totals.

## Components

| Component key | Field |
| --- | --- |
| `OmeWooCartTotalsList` | Container for total atoms on cart pages. |
| `OmeWooTotalsSubtotal` | `total_items` |
| `OmeWooTotalsDiscount` | `total_discount` |
| `OmeWooTotalsShipping` | `total_shipping` |
| `OmeWooTotalsTax` | `total_tax` |
| `OmeWooTotalsTotal` | `total_price` |

The same total atoms are also used in `OrderSummaryTotalsList` on checkout pages.

## Authoring Structure

```text
CartTotalsList
  TotalsSubtotal
  TotalsDiscount
  TotalsShipping
  TotalsTax
  TotalsTotal
```

## List Props

| Prop | Meaning |
| --- | --- |
| `structure.root_tag` | Wrapper element for the list. |
| `styling.list_class` | Class prop for the list wrapper. |

## Atom Props

All total atoms share props from `CartTotalProperties`.

| Prop | Meaning |
| --- | --- |
| `content.show_label` | Renders label and value in a wrapper when true. |
| `content.label` | Label text when labels are enabled. |
| `content.label_position` | `prefix` or `suffix`. |
| `structure.html_tag` | Wrapper tag when label is enabled. |
| `styling.value_class` | Class prop for the value span. |
| `styling.class` | Wrapper class when label is enabled. |
| `styling.label_class` | Label class when label is enabled. |

## Runtime Behavior

`cart-totals.ts` formats minor-unit Store API totals using currency metadata from the response. It updates every matching `data-ome-woo-cart-total-field`, except fields inside an order summary when the cart page binding is running. `OrderSummary` owns its own summary total rendering.

## Scenario Coverage

| Scenario | Covered behavior |
| --- | --- |
| `cart_totals_taxed_cart` | Tax, subtotal, and final total render for a seeded taxable cart. |
| `cart_totals_and_empty_slot` | Empty cart keeps totals at zero. |
| `cart_page_update_and_remove` | Quantity and removal refresh totals. |
| `shipping_selector` | Shipping rate selection updates shipping and total. |
| `lifecycle pricing` | Native Woo pricing hooks change rendered totals. |
