Cart Subtotal Minus Discount
{exp:cartthrob:cart_subtotal_minus_discount} outputs subtotal minus discount.
In this context:
- base subtotal excludes shipping
- discount is subtracted from subtotal
- result is never less than
0
See also:
Parameters
Modifiers
Use modifiers to control whether tax is included and whether output is formatted.
To get a raw numeric value for subtotal minus discount:
{exp:cartthrob:cart_subtotal_minus_discount:numeric}
To get subtotal with tax, minus discount:
{exp:cartthrob:cart_subtotal_minus_discount:plus_tax}
To get a raw numeric value for subtotal with tax, minus discount:
{exp:cartthrob:cart_subtotal_minus_discount:plus_tax:numeric}
Output and Behavior
- Base calculation is
max(cart subtotal - cart discount, 0). :numericreturns that base value without number formatting.:plus_taxswitches the base calculation tomax(cart subtotal_with_tax - cart discount, 0).:plus_tax:numericreturns the plus-tax calculation without number formatting.- Default output is number-formatted using CartThrob number formatting settings.
- Shipping is not included by this tag.
Example
Basic subtotal minus discount
{exp:cartthrob:cart_subtotal_minus_discount}
Subtotal with tax minus discount
{exp:cartthrob:cart_subtotal_minus_discount:plus_tax}
Raw numeric value for calculations
{exp:cartthrob:cart_subtotal_minus_discount:plus_tax:numeric}