This article applies to Discount Ninja version 3 and above

Find your cart template first. Not sure how to find or edit the file? Read this article first.

Root

Find the root of the cart, which contains all cart lines and the subtotal. Add the class limoniapps-discountninja-cart-root to it. Typically this is the form tag.

Where you put this will be different for each theme. Here's one example:

Another example:

Product price

Note that the product price on a cart is different from the line price. The line price is the price of the product times its quantity.
Some themes show the product price on the cart, some do not. Look for a section that contains {{ item.price }}. The exact html varies per theme.
If your theme includes such a section, add a class limoniapps-discountninja-cart-item-product-price to the html element of that section as well as this data tag data-limoniapps-discountninja-cart-key="{{item.key}}".

Example:

<div class="other classes limoniapps-discountninja-cart-item-product-price" data-limoniapps-discountninja-cart-key="{{item.key}}">
  ... {{ item.price }} ...
</div>

Optional: "Below product title" comment

You can add a section where the product comment will be displayed. This comment can be defined per promotion and allows you to show on a cart which promotion is applied to which product (example: 20% off thanks to our winter promotion!). Discount Ninja looks for a section with the class limoniapps-discountninja-cart-item-product-comment and adds the comment at that location.

The markup for that section is as follows:

<div class="limoniapps-discountninja-cart-item-product-comment" data-limoniapps-discountninja-cart-key="{{item.key}}"></div>

Line price

Note that the product price on a cart is different from the line price. The line price is the price of the product times its quantity.
Some themes show the line price on the cart, some do not. Look for a section that contains {{ item.line_price }}. The exact html varies per theme.
If your theme includes such a section, add a class limoniapps-discountninja-cart-item-line-price to the html element of that section as well as this data tag data-limoniapps-discountninja-cart-key="{{item.key}}".

Example:

<div class="other classes limoniapps-discountninja-cart-item-line-price" data-limoniapps-discountninja-cart-key="{{item.key}}">
  ... {{ item.line_price }} ...
</div>

Subtotal

Find the section that contains the subtotal. This section will include a reference to {{ cart.total_price }}. The exact html varies per theme.
The subtotal section needs a class limoniapps-discountninja-cart-subtotal-price.

Example:

<div class="other classes limoniapps-discountninja-cart-subtotal-price">
  ... {{ cart.total_price }} ...
</div>

[Optional] Subtotal comment

You can add a section where the subtotal comment will be displayed. This comment can be defined in the settings of the app (example: Discount applied. 30% off!).
Discount Ninja looks for a section with the class limoniapps-discountninja-cart-subtotal-comment and adds the comment at that location.

<span class="limoniapps-discountninja-cart-subtotal-comment"></span>

Checkbox

If you have a "terms and conditions" checkbox, mark it with the class limoniapps-discountninja-checkout-checkbox to ensure Discount Ninja respects it.
You're typically looking for an input HTML element of type checkbox.

Example:

<input id="terms" type="checkbox" class="other classes limoniapps-discountninja-checkout-checkbox" value="I accept the terms and conditions">

[Optional] Discount field

Add the following line to add the discount field to the cart:

<div class="limoniapps-discountninja-cartdiscountfield-placeholder"></div>
Did this answer your question?