User Guide | Database Cart Data 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.

Database Cart Data Configuration

Database Cart Data Function Index | Database Cart Data Admin Data
Config Setup Information

Table Schema Diagram

Table Settings

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

Cart Data Schema Diagram

A database table schema diagram, showing how the order tables are related to each other and the database cart data, custom item and user tables.
Note: The custom user table must be created by you. The diagram highlights how it can be related to the database cart data table.
Table and columns names are defined using their internal names.

Database Cart Data Table

Contains cart data that has been saved to the database so that the cart session can be reloaded at a later time.

Table and Column Names
Internal Name Default Name Data Type Description
table cart_data - The tables name.
id cart_data_id int The tables primary key.
user cart_data_user_fk int Relates the database cart data to a user.
The value CAN be used to act as a foreign key relating the table to the primary key of a custom user table, although this is not joined by default.
cart_data cart_data_array string The serialized cart data array.
date cart_data_date string | int The date and time that the cart data was last saved.
The data type of this column can either be mysql datetime or a unix timestamp.
Read the internal config documentation regarding setting the carts date and time settings.
readonly_status cart_data_readonly_status bool Defines whether the cart data can only be read from and not overwritten.
Internally, the cart sets data that is related to a confirmed order to be readonly, preventing the accidental loss an orders internal cart data.
The readonly status can still be overridden by specifically defining to do so via flexi cart functions that manage database cart data.

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

The related order summary table and custom user tables do not need to be enabled to use the database cart data table.

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

$config['database']['db_cart_data']['table'] = 'cart_data';
$config['database']['db_cart_data']['columns']['id'] = 'cart_data_id';
// Example #2 : Disabling the table.

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