Discount Ninja
  • Discount Ninja Developer Hub
    • Storefront API
      • Promotion Engine
        • Enable
        • JavaScript API
          • Functions
          • Events
          • Objects
      • Widgets
        • Guiding principles
          • Accessibility
          • Localization
          • Integration
          • Style
        • Announcement Bar
        • Notification
        • Offer Rules Popup
        • Product Banner
        • Promotion Summary
        • Promotion Code Field
        • Promotional Badge
    • Integration
    • Theme edits
      • App blocks
        • Product Page Banner
        • Promo Code Field
        • Promotion Summary
      • Code edits
        • Product Detail Page (PDP)
          • Price
          • Banner
          • Badge
        • Product List Page (PLP) and Collections
          • Attributes
          • Price
            • Searchanise Search & Filter
            • Globo Smart Product Filter & Search (aka SPF)
            • AI Search & Product Filter (Ultimate Search)
            • Boost AI Search & Filter (aka PFS)
          • Badge
          • Pagination
          • Quick View
        • Cart
          • Root
          • Cart item
          • Promo Code Field
          • Promotion Summary
          • Subtotal
        • Gift With Purchase
Powered by GitBook
On this page
  • Location
  • Snippet
  • Built-in order discounts
  • Snippet
  • Example

Was this helpful?

  1. Discount Ninja Developer Hub
  2. Theme edits
  3. Code edits
  4. Cart

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:

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.

limoniapps-discountninja-whenpromotionsincart-hide

Example

The following example shows how all the elements come together:

<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>
PreviousPromotion SummaryNextGift With Purchase

Last updated 3 months ago

Was this helpful?