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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
