discount

The discount object contains information about a discount, including its id, code, amount, savings, and type. Note that this object will display a value only if it's accessed in notifications or in the Order Printer app.

The discount object has the following attributes:

discount.id

Returns the id of the discount.

discount.title

Returns the title or discount code of the discount.

Input

{{ discount.title }}

Output

SPRING14

discount.code

Returns the title or discount code of the discount. Same as discount.title.

discount.amount

Returns the amount of the discount. Use one of the money filters to return the value in a monetary format.

Input

{{ discount.amount | money }}

Output

$25

discount.total_amount

Returns the total amount of the discount if it has been applied to multiple line items. Use a money filter to return the value in a monetary format.

discount.savings

Returns the amount of the discount's savings. The negative opposite of amount. Use one of the money filters to return the value in a monetary format.

Input

{{ discount.savings | money }}

Output

$-25

discount.total_savings

Returns the total amount of the discount's savings if it has been applied to multiple line items. The negative opposite of total_amount. Use a money filter to return the value in a monetary format.

discount.type

Returns the type of the discount. The possible values of discount.type are:

  • FixedAmountDiscount
  • PercentageDiscount
  • ShippingDiscount

Want to discuss this page?

Visit the Shopify Community