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

Cart Functionality Configuration

Cart Column Config | Cart Internal Settings Config
Cart Config Function Index | Get Cart Config Session Data | Set Cart Config Session Data | Cart Config Admin Data
Config Setup Information

Configuration Descriptions

Table and Config File Settings

Define via the Database Table | Define via the Config File

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

Configuration Descriptions

Below is a compiled list of all the cart configuration settings that can be set either via the configuration database table, or via the config file itself.


order_number_prefix

Default: FALSE | Data Type: string


Defines a value prefixed to the cart order number.

Note: Do not set a number as a prefix value if using incremental order numbers.

order_number_suffix

Default: FALSE | Data Type: string


Defines a value suffixed to the cart order number.

Note: Do not set a number as a suffix value if using incremental order numbers.

increment_order_number

Default: TRUE | Data Type: bool


Defines whether the order number should be incremented from the last order number.

If 'FALSE' is set, a randomly generated number will be used.
Order number prefixes and suffixes can still be applied to either format.

minimum_order

Default: 0 | Data Type: int


Defines the minimum order value.

This value can then be checked against the value of a particular summary column.

quantity_decimals

Default: 0 | Data Type: int


Defines how many decimals are acceptable for item quantities.

Typically, this should be zero, however, some situations may require half quantities that would be entered into the cart as '0.5', this would require 1 decimal.

increment_duplicate_item_quantity

Default: TRUE | Data Type: bool


Defines whether a cart items quantity should be incremented when an identical duplicate is added to the cart.

If 'FALSE' is set, the new quantity will be used.

quantity_limited_by_stock

Default: TRUE | Data Type: bool


If the item stock table is enabled, defines whether the maximum quantity of cart items should be limited to the databases stock quantity.

Example: Database item stock quantity equals 3, user adds an item quantity of 5, the cart will then alter the item cart quantity back to 3.

remove_no_stock_items

Default: FALSE | Data Type: bool


If the item stock table is enabled, defines whether out-of-stock items should be automatically removed from the cart.
If 'TRUE' is set, and an out-of-stock item is added to the cart, the item will be immediately removed.

auto_allocate_stock

Default: TRUE | Data Type: bool


If the item stock table is enabled, defines whether stock quantities should be automatically updated and managed by flexi cart.

If 'TRUE' is set, when an order is confirmed, items within the cart that are also in the item stock table will have their stock deducted.
Likewise, if items within an order are cancelled, they will be auto restocked into the item stock table.

save_banned_shipping_items

Default: FALSE | Data Type: bool


Defines whether an item that is not permitted to be shipped to the current shipping location, should be saved to the database if the user still completes the order.

weight_type

Default: gram | Data Type: string


Sets the default weight type to display weights by.

The available weight types are 'gram', 'kilogram', 'avoir_ounce', 'avoir_pound', 'troy_ounce', 'troy_pound' and 'carat'.

weight_decimals

Default: 0 | Data Type: int


Sets the default number of decimals to display weights by.

Note: A weights decimal and thousand separator characters are controlled by the current currency separators.

display_tax_prices

Default: TRUE | Data Type: bool


Defines whether item prices should be displayed including tax by default.

price_inc_tax

Default: TRUE | Data Type: bool


Defines whether item prices typically include tax when added to the cart.

Note: Specific tax rates can be set for individual items.

multi_row_duplicate_items

Default: FALSE | Data Type: bool


Defines whether all duplicate cart items should be added as a new separate row in the cart.

If 'FALSE' is set, the existing item will be updated.

dynamic_reward_points

Default: TRUE | Data Type: bool


Defines whether reward points should be based on the internal value of an item, or should be based on the items current tax rate based price.

Example: An item is added to the cart costing £20 including 20% tax, the user then ships to a 10% tax zone, so the item now costs £18.33.
i.e. Remove 20% tax: £20 / 20% = £16.67, then add 10% tax: £16.67 * 10% = £18.33.

If 'FALSE' is set, the reward points will be based on the internal value of an item.

reward_point_multiplier

Default: 10 | Data Type: int


Defines how many reward points are awarded per 1.00 currency unit of an items price.

Example: A multiplier of 10 is (10 x £1.00) = 10 reward points. Therefore, an item priced at £100 would be worth 1000 reward points.

Reward points are always rounded to the nearest whole number.
Reward points can be manually defined when adding items to the cart.

reward_voucher_multiplier

Default: 0.01 | Data Type: int


Define how much each reward point is worth as a currency value when converted to a reward voucher.

Example: If 250 reward points were converted using a multiplier of £0.01 per point, the reward voucher would be worth £2.50 (250 x 0.01).

reward_point_to_voucher_ratio

Default: 250 | Data Type: int


Defines how many reward points are required to create 1 reward voucher.

Examples:
A ratio of 250 means for every 250 reward points, 1 voucher worth 250 points can be created, this voucher is then worth a defined currency value.
A customer with 500 reward points could create either 1 voucher of 500 points, or 2 vouchers with 250 points each.
A customer creating a voucher with 525 reward points, would only be able to convert and use 500 points, the remaining 25 remain as active reward points.

reward_point_days_pending

Default: 14 | Data Type: int


Defines after how many days that reward points earnt from an ordered item that has been 'shipped' become active.

The idea of this option is to prevent a customer from placing an order soley to earn reward points, then purchasing a second order using a reward voucher earnt from the first order. The customer could then return the first order for a refund, but the reward points earnt from it have already been used to purchase the second order at a cheaper price.

The number of days set should typically reflect the stores return policy, for example, if items cannot be returned after 14 days, the reward points should only become active after 14 days.

Note: If flexi carts 'shipped item' feature has been disabled, the points become active 'x' days after the order was first received rather than the date they were shipped.

reward_point_days_valid

Default: 365 | Data Type: int


Defines how many days that reward points are valid for.

Example: 365 = 365 days (1 year).

Note: If soon to expire reward points are converted to a voucher, the voucher will then be valid for the number of set voucher days.

reward_voucher_days_valid

Default: 365 | Data Type: int


Defines how many days that reward vouchers are valid for.

Example: 365 = 365 days (1 year).

custom_status_1

Default: NULL | Data Type: string


Defines the default value of custom status #1.

The status can be set to match the custom status requirements of a discount, if the statuses do not match, then the discount does not get activated.

custom_status_2

Default: NULL | Data Type: string


Defines the default value of custom status #2.

The status can be set to match the custom status requirements of a discount, if the statuses do not match, then the discount does not get activated.

custom_status_3

Default: NULL | Data Type: string


Defines the default value of custom status #3.

The status can be set to match the custom status requirements of a discount, if the statuses do not match, then the discount does not get activated.

Defining Cart Configuration via the Database Table

Contains general site settings that control specific functions and calculations of the shopping cart.

Table and Column Names
Help
Internal Name Default Name Data Type Description
table cart_config - The tables name.
order_number_prefix config_order_number_prefix string See description
order_number_suffix config_order_number_suffix string See description
increment_order_number config_increment_order_number bool See description
minimum_order config_min_order int See description
quantity_decimals config_quantity_decimals int See description
increment_duplicate_item_quantity config_increment_duplicate_items bool See description
quantity_limited_by_stock config_quantity_limited_by_stock bool See description
remove_no_stock_items config_remove_no_stock_items bool See description
auto_allocate_stock config_auto_allocate_stock bool See description
save_banned_shipping_items config_save_ban_shipping_items bool See description
weight_type config_weight_type string See description
weight_decimals config_weight_decimals int See description
display_tax_prices config_display_tax_prices bool See description
price_inc_tax config_price_inc_tax bool See description
multi_row_duplicate_items config_multi_row_duplicate_items bool See description
dynamic_reward_points config_dynamic_reward_points bool See description
reward_point_multiplier config_reward_point_multiplier int See description
reward_voucher_multiplier config_reward_voucher_multiplier int See description
reward_point_to_voucher_ratio config_reward_voucher_ratio int See description
reward_point_days_pending config_reward_point_days_pending int See description
reward_point_days_valid config_reward_point_days_valid int See description
reward_voucher_days_valid config_reward_voucher_days_valid int See description
custom_status_1 config_custom_status_1 bool See description
custom_status_2 config_custom_status_2 bool See description
custom_status_3 config_custom_status_3 bool See description
Requirements

No columns are required, all disabled columns must be set as 'FALSE'.

If a column is disabled, the hard coded default value defined via the config file will be used.

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

$config['database']['configuration']['table'] = 'cart_config';
$config['database']['configuration']['columns']['id'] = 'config_id';
// Example #2 : Disabling a column.

$config['database']['configuration']['columns']['order_number_prefix'] = FALSE;
// Example #3 : Disabling the table.

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

Defining Cart Configuration via the Config File.

Default cart configuration settings can be set to configure the cart when it is first loaded.

Setting default values via the config file is only necessary if the configuration database table is not enabled.

Defaults set via the config file are only used if no default value has been set by the configuration database table.

Example
// Example of defining an order number prefix set via the config file.

$config['defaults']['configuration']['order_number_prefix'] = 'example_prefix';