The discount_application object
Captures the intent of a discount applied on an order.
The object can be accessed on customer order and notification templates. Shopify Plus merchants can also access properties of the discount_allocation
object in the checkout.liquid layout file.
To learn how to represent discounts in your theme using the discount_application
object, refer to Discounts.
The discount_application
object has the following attributes:
discount_application.target_selection
Anchor link to section titled "discount_application.target_selection"Describes how a discount selects line items in the cart to be discounted. target_selection
has the following possible values:
all
: The discount applies to all line items.entitled
: The discount applies to a particular subset of line items, often defined by a condition.explicit
: The discount applies to a specifically selected line item or shipping line.
discount_application.target_type
Anchor link to section titled "discount_application.target_type"Describes the type of item that a discount applies to. target_type
has the following possible values:
line_item
shipping_line
discount_application.title
Anchor link to section titled "discount_application.title"The customer-facing name of the discount. For example, Welcome10
or CBBWQQAKYBYY
.
discount_application.total_allocated_amount
Anchor link to section titled "discount_application.total_allocated_amount"The total amount that the price of an order is reduced by the discount.
discount_application.type
Anchor link to section titled "discount_application.type"The type of the discount. type
has the following possible values:
automatic
discount_code
manual
script
discount_application.value
Anchor link to section titled "discount_application.value"The value of the discount.
discount_application.value_type
Anchor link to section titled "discount_application.value_type"The value type of the discount. value_type
has the following possible values:
fixed_amount
percentage