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

Has Tax

{exp:cartthrob:has_tax} returns whether the current cart has a tax amount greater than 0.

See also:

Parameters

This tag has no parameters.

Output

This tag returns string values:

  • TRUE when tax is greater than zero.
  • FALSE when tax is zero.

The check is based on the cart tax total (cart->tax()), cast to float.

Examples

Code:

{exp:cartthrob:has_tax}

Conditional:

{if "{exp:cartthrob:has_tax}" == "TRUE"}
    Tax is applied.
{/if}