User Guide | Getting Tax Session Data

When the flexi cart library is first loaded, an array is automatically created that is setup to match the carts default settings, this data is then stored in the browsers session. All items and settings that are then later added and altered within the cart are updated to the carts session data.

The data within the carts session can then be accessed and in many cases, formatted and customised using the large range of functions that are available from the lite and standard libraries.

Get Tax Session Data

Tax Function Index | Tax Config | Set Tax Session Data | Tax Admin Data
Get Tax Data from Session

tax_name() | tax_rate()

Get Tax Location Data from Session

tax_location_data() | match_tax_location_id() | tax_location_id() | tax_location_name()

Get Tax Location Data from Session

display_prices_inc_tax() | cart_prices_inc_tax()

Help with Session Data Functions

Show / Hide Help

Name: The name of the function (method).

Data Type: The data type that is expected by the function.

  • bool : Requires a boolean value of 'TRUE' or 'FALSE'.
  • string : Requires a textual value.
  • int : Requires a numeric value. It does not matter whether the value is an integer, float, decimal etc.
  • array : Requires an array.

Required: Defines whether the parameter requires a value to be submitted.

Default: Defines the default parameter value that is used if no other value is submitted.

tax_name()

Returns the name of the current tax (Example 'VAT', 'GST' etc.).


Library and Requirements

Available via the lite, standard and admin libraries.

Does not require any database tables to be enabled.

Return Values

Failure:n/a

Success:string

Examples
Note: The returned example values below are displaying live data from the current cart session data.
tax_name() What is the name of the current tax? VAT

tax_rate()

Returns the carts current tax rate, the rate is by default formatted to suffix a '%' symbol on the end, this can be omitted by submitting FALSE.
The carts internal tax rate can be returned submitting $internal_value as TRUE.


Library and Requirements

Available via the lite, standard and admin libraries.

Does not require any database tables to be enabled.

Function Parameters
tax_rate(suffix_delimiter, internal_value) Help
Name Data Type Required Default Description
suffix_delimiter string No % Defines a value that is suffixed to the end of the tax rate.
internal_value bool No FALSE Defines whether to return the carts internal tax rate rather than the users current tax rate.
Return Values

Failure:n/a

Success:int | (string if value is formatted)

Examples
Note: The returned example values below are displaying live data from the current cart session data.
tax_rate('%', FALSE) Display the current tax rate with a percentage sign immediately after it. 20%
tax_rate(' %', FALSE) Display the current tax rate with a spacer and percentage sign immediately after it. 20 %
tax_rate(' %', TRUE) Display the internal tax rate with a spacer and percentage sign immediately after it. 20 %