Cart Subtotal
{exp:cartthrob:cart_subtotal} outputs the cart subtotal for all cart line items.
In this context, subtotal means:
- includes item price × quantity totals
- excludes shipping
- excludes tax
- excludes discounts
This makes it a useful pre-tax/pre-shipping amount for cart summaries.
See also:
Parameters
This tag has no tag-specific parameters.
It supports Global Number Formatting options for formatted output.
Modifiers
Use modifiers when you need raw values or tax-inclusive subtotal behavior.
To get a raw numeric value for the cart subtotal:
{exp:cartthrob:cart_subtotal:numeric}
To get the cart subtotal with tax included:
{exp:cartthrob:cart_subtotal:plus_tax}
To get a raw numeric value for the cart subtotal with tax included:
{exp:cartthrob:cart_subtotal:plus_tax:numeric}
Output and Behavior
- Default output is number-formatted using CartThrob number formatting settings.
:numericreturns the raw subtotal numeric value (no number formatting).:plus_taxswitches the calculation to subtotal-with-tax.:plus_tax:numericreturns subtotal-with-tax as a raw numeric value.
Implementation notes:
- Base subtotal uses the cart
subtotal()calculation (sum of itemprice_subtotal()values). plus_taxusessubtotal_with_tax().- Neither mode includes shipping.
- Base subtotal does not subtract discounts.
Example
Basic subtotal
{exp:cartthrob:cart_subtotal}
Raw value for calculations
{exp:cartthrob:cart_subtotal:numeric}
Subtotal with tax
{exp:cartthrob:cart_subtotal:plus_tax}