Cart Discount
cart_discount outputs the current cart discount total.
If no coupon/discount is active, this typically outputs zero.
See also:
Parameters
This tag has no tag-specific parameters.
Number output formatting follows Global Number Formatting.
Modifiers
:numeric
Return the raw numeric discount value (unformatted).
{exp:cartthrob:cart_discount:numeric}
:minus_tax
Return the discount with the discount-related tax portion removed.
Implementation detail: this is calculated as discount + discount_tax, then formatted.
{exp:cartthrob:cart_discount:minus_tax}
:minus_tax:numeric
Return the same minus_tax result as a raw numeric value.
{exp:cartthrob:cart_discount:minus_tax:numeric}
Behavior and Constraints
- Base value comes from
ee()->cartthrob->cart->discount(). :minus_taxusesdiscount + discount_tax.- Modifier order matters: only
:minus_tax:numericreturns numeric minus-tax output. - Without
:numeric, output is formatted throughee()->number->format().
Example
Basic formatted output:
{exp:cartthrob:cart_discount}
Raw numeric output for calculations:
{exp:cartthrob:cart_discount:numeric}
Note: these examples require an active coupon/discount to show a non-zero discount value.