# 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>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.discountninja.io/discount-ninja-developer-hub/theme-edits/code-edits/cart/root.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
