The discount object

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.amount

Returns the amount of the discount. This amount is in the customer's local (presentment) currency. Use one of the money filters to return the value in a monetary format.

Input

{{ discount.amount | money }}

Output

$25

discount.code

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

discount.id

Returns the id of the discount.

discount.savings

Returns the amount of the discount's savings. The negative opposite of amount. This amount is in the customer's local (presentment) currency. Use one of the money filters to return the value in a monetary format.

Input

{{ discount.savings | money }}

Output

$-25

discount.title

Returns the title or discount code of the discount.

Input

{{ discount.title }}

Output

SPRING14

discount.total_amount

Returns the total amount of the discount if it has been applied to multiple line items. This amount is in the customer's local (presentment) currency. Use a money filter to return the value in a monetary format.

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. This amount is in the customer's local (presentment) currency.m 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

Ready to start selling with Shopify?

Try it free