CartThrob 9 documentation for ExpressionEngine commerce teams Visit CartThrob.com
CartThrob.com

Cart Tax

{exp:cartthrob:cart_tax} outputs the current tax total for the cart.

This is commonly shown in cart and checkout summaries.

See also:

Parameters

This tag has no tag-specific parameters.

Default output is formatted through ExpressionEngine’s number formatter. Use :numeric when you need an unformatted value for calculations.

Modifiers

To get a raw numeric value for the cart tax total:

{exp:cartthrob:cart_tax:numeric}

Output and Behavior

  1. Base value comes from cart->tax().
  2. Tax calculation includes:
    • item tax
    • shipping tax
    • minus discount tax
  3. The result is never returned below 0.
  4. If there are no taxable items, shipping tax can still be returned when applicable.
  5. :numeric returns the raw numeric value; default output is formatted text.

Example

Basic cart tax

{exp:cartthrob:cart_tax}

Raw numeric tax value

{exp:cartthrob:cart_tax:numeric}