Tax Configuration
Tax Function Index |
Get Tax Session Data |
Set Tax Session Data |
Tax Admin Data
Help with the Table Configuration
Show / Hide Help
Internal Name: The name that flexi cart internally references the table or column by.
Default Name: The default table or column name used in the actual table.
Data Type: The data type that is expected by the table column.
- bool : Requires a boolean value set as either '0' (FALSE) or '1' (TRUE).
- string : Requires a textual value.
- int : Requires a numeric value. It does not matter whether the value is an integer, float, decimal etc.
Config File Location
The config file is located in CodeIgniters 'config' folder and is named 'flexi_cart.php'.
Tax Table Schema Diagram
A database table schema diagram, showing how the tax table is related to the location tables.
Table and columns names are defined using their internal names.
General Tax Setup Notes
Below are some general notes to consider when setting up and managing the tax table.
-
When the cart data is first set to the browsers session, the default tax location is set as the carts tax location.
If there are multiple tax rates available to the tax location, the tax rate defined as the default is selected.
If the default rate is not within the default tax location, it will only be selected if there are no other tax rates available in the default tax location.
Tax Table
Contains tax rates for specific locations and zones.
Table and Column Names
Help
Internal Name |
Default Name |
Data Type |
Description |
table |
tax |
- |
The tables name. |
id |
tax_id |
int |
The tables primary key. |
location |
tax_location_fk |
int |
Relates the tax rate to a location, so it will only be displayed if that location is set.
The value acts as a foreign key relating the table to the primary key of the location table.
|
zone |
tax_zone_fk |
int |
Relates the tax rate to a location zone, so it will only be displayed if a location from that zone is set.
The value acts as a foreign key relating the table to the primary key of the location zone table.
|
name |
tax_name |
string |
The name of the tax rate. |
rate |
tax_rate |
int |
The percentage value of the tax rate. |
status |
tax_status |
bool |
Defines the status of whether the tax rate is active or disabled.
Disabled records will not be used by flexi cart functions.
|
default |
tax_default |
int |
Defines the default tax rate to be applied to the cart when first loaded.
A table row defined as the default tax rate should be indicated with a value of 1.
This table column can be disabled.
|
Requirements
If the table is enabled, then with the exception of 'default', all other columns are required.
If the 'default' column is disabled, the cart will use the default tax rate defined via the config file.
The related location tables do not need to be enabled to use the tax table.
Example
$config['database']['tax']['table'] = 'tax';
$config['database']['tax']['columns']['id'] = 'tax_id';
$config['database']['tax']['default'] = 'tax_default';
$config['database']['tax']['table'] = FALSE;
Defining Tax Defaults via the Config File.
A default tax rate can be set to correctly configure the cart when it is first loaded.
Setting default values via the config file is only necessary if the tax database table is not enabled.
If the tax table is enabled, the default tax rate can be defined by entering the value '1' into the row of the tables 'default' column.
Default tax settings set via the config file are only used if no default value has been set in the tax database table.
Default Settings
Parameter Name |
Data Type |
Description |
name |
string |
Sets the name of the default tax rate. |
rate |
int |
Sets the percentage of the default tax rate. |
Notes
Example
$config['defaults']['tax']['name'] = 'VAT';
$config['defaults']['tax']['rate'] = 20;
$config['defaults']['tax']['name'] = FALSE;
$config['defaults']['tax']['rate'] = FALSE;