> 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/subtotal.md).

# Subtotal

## Location

Find the section that contains the subtotal. This section will include the subtotal price (see above) and, typically, the word "Subtotal" or "Total". The exact html varies per theme. To hide the subtotal section when the promotion summary is displayed, the subtotal section must be marked. The subtotal price must also be marked.

## Snippet

Use the following class to mark the subtotal section:

```html
limoniapps-discountninja-cart-subtotal
```

Use the following class to mark the subtotal price:

```
limoniapps-discountninja-cart-subtotal-price
```

## Built-in order discounts

### Snippet

Use the following CSS class to hide the section (or sections), that render order discounts. This avoids that the subtotal shows order discounts twice, once from the built-in discounts and once from Discount Ninja.

```css
limoniapps-discountninja-whenpromotionsincart-hide
```

## Example

The following example shows how all the elements come together:

```html
<div class="other classes limoniapps-discountninja-cart-subtotal">
  ... Total ...
  <div class="other classes limoniapps-discountninja-cart-subtotal-price">
  ... {{ cart.total_price | money }} ...
  </div>
</div>
...
<div class="limoniapps-discountninja-whenpromotionsincart-hide">
  {%- if cart.cart_level_discount_applications.size > 0 -%}
    <ul class="discounts">
      {%- for discount in cart.cart_level_discount_applications -%}
        <li class="discounts__discount">
          {%- render 'icon-discount' -%}
          {{ discount.title }}
          (-{{ discount.total_allocated_amount | money }})
        </li>
      {%- endfor -%}
    </ul>
  {%- endif -%}
</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/subtotal.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.
