# 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: 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/subtotal.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.
