> For the complete documentation index, see [llms.txt](https://developers.discountninja.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.discountninja.io/discount-ninja-developer-hub/theme-edits/code-edits/cart/root.md).

# Root

{% hint style="info" %}
This section is only required for a drawer cart, it is not required for a classic cart page.
{% endhint %}

## Drawer Cart

### Snippet

Use the following attribute to mark the root of the drawer cart. The root refers to the section that spans all line items and the subtotal section.

```html
la-dn-drawercart-root
```

### Example

```html
<div id="drawer-cart" la-dn-drawercart-root>
    ...
    ... line items
    ...
    ... subtotal
    ...
</div>
```

### Separate subtotal and line items

Some themes have separate sections for the subtotal and the line items. If this is the case, you can use the following attributes instead:

```
la-dn-drawercart-lineitems
la-dn-drawercart-cartsummary
```

### Example

```html
<div id="drawer-cart-lines" la-dn-drawercart-lineitems>
    ...
    ... line items
    ...
</div>
<div id="drawer-cart-form" la-dn-drawercart-cartsummary>
    ...
    ... subtotal
    ...
</div>
```

## Cart

### Snippet

Use the following attribute to mark the root of the drawer cart. The root refers to the section that spans all line items and the subtotal section.

```html
la-dn-cart-root
```

### Example

```html
<div id="drawer-cart" la-dn-cart-root>
    ...
    ... line items
    ...
    ... subtotal
    ...
</div>
```

### Separate subtotal and line items

Some themes have separate sections for the subtotal and the line items. If this is the case, you can use the following attributes instead:

```
la-dn-cart-lineitems
la-dn-cart-cartsummary
```

### Example

```html
<div id="cart-lines" la-dn-cart-lineitems>
    ...
    ... line items
    ...
</div>
<div id="cart-form" la-dn-cart-cartsummary>
    ...
    ... subtotal
    ...
</div>
```
