Discount Info
Outputs one row per currently valid/applied discount for the active cart. Each row includes discount settings data, a formatted discount amount for the current cart context, and entry variables from the discount entry.
See also:
- cart_discount,
- cart_discount_percent_of_subtotal,
- cart_discount_percent_of_total,
- coupon_info,
- discounts
Parameters
This tag has no tag-specific parameters.
Variables
In addition to the variables listed here, this tag also includes entry
variables from the discount channel entry (for example {title},
{url_title}, and your custom fields).
Most discount settings are available with a discount_ prefix.
Example: discount_type, discount_entry_id, discount_member_groups.
discount_type
The classname of the discount plugin in use for this discount.
{discount_type}
Cartthrob_discount_amount_off
discount_amount
Formatted discount amount contributed by this discount for the current cart.
{discount_amount}
$5.00
Conditionals
{if no_results}
If there are no currently valid discounts, the content inside this conditional is shown.
{if no_results}
No discounts
{/if}
Behavior and Constraints
Code-backed behavior:
- Loads valid discounts from
discount_model->get_valid_discounts(). - Prefixes returned discount data keys with
discount_. - Calculates and formats per-discount amount for current cart context.
- Merges discount entry variables into each output row.
Notes:
- Output is one row per currently valid discount.
- If no discounts are valid/applied,
{if no_results}can be used. - Amount values are formatted strings.
Examples
{exp:cartthrob:discount_info}
{if no_results}No discounts are currently active{/if}
Discount Entry Title: {title}
Discount Type: {discount_type}
Discount Amount: {discount_amount}
{/exp:cartthrob:discount_info}