User Guide | Item Tax Configuration

flexi cart contains many features to aid the custom development of an e-commerce site.
In some instances, some of the features may be considered overkill, or may not require a database table to handle a feature.
In these cases, specific database tables can be disabled, or with some tables, specific columns can be disabled if not required.

In addition to this, the database tables and columns can be renamed to match the custom naming conventions.

Item Tax Configuration

Item Tax Function Index | Get Item Tax Helper Data | Item Tax Admin Data
Config Setup Information

Table Schema Diagram | Setup Notes

Table Settings

Item Tax Table

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'.

Item Tax Table Schema Diagram

A database table schema diagram, showing how the item tax table is related to the location and custom item tables.
Note: The custom item table must be created by you. The diagram highlights how it is then related to the item tax table.
Table and columns names are defined using their internal names.

General Item Tax Setup Notes

Below are some general notes to consider when setting up and managing the item tax table.

  • When an item is added to the cart, the priority of setting the items tax rate is done as follows:
    First the submitted item data is checked for a manually entered tax rate. The cart will then check if there is a value set in the item tax table. Then finally the carts current tax rate is applied to the item.
  • If multiple item tax rates are available to the carts current tax location, then only the first rule ordered by the lowest table row id will be returned.

Item Tax Table

Contains tax rates for specific cart items.

Table and Column Names
Internal Name Default Name Data Type Description
table tax_item_rates - The tables name.
id tax_item_id int The tables primary key.
item tax_item_item_fk int Relates the item tax rate to an item (product).
The value acts as a foreign key relating the table to the primary key of a custom item (product) table.
location tax_item_location_fk int Relates the item 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_item_zone_fk int Relates the item 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 zones table.
rate tax_item_rate int The percentage value of the item tax rate.
status tax_item_status bool Defines the status of whether the item tax rate is active or disabled.
Disabled records will not be used by flexi cart functions.

If the table is enabled, then all columns are required.

The related location tables do not need to be enabled to use the item tax table.

The item tax table has a one-to-many relationship with an item, i.e. one item can have many tax rates setup for different locations.
Therefore, the item tax data must be setup as a table seperate from the custom user defined item table.

// Example #1 : Defining the table and column names.

$config['database']['item_tax']['table'] = 'tax_item_rates';
$config['database']['item_tax']['columns']['id'] = 'tax_item_id';
// Example #2 : Disabling the table.

$config['database']['item_tax']['table'] = FALSE;