User Guide | Shipping 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.

Shipping Configuration

Shipping Function Index | Get Shipping Session Data | Get Shipping Helper Data | Set Shipping Session Data | Shipping Admin Data
Config Setup Information

Table Schema Diagram | Setup Notes

Table and Config File Settings

Shipping Table | Shipping Rate Table | Setting Defaults via 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'.

Shipping Tables Schema Diagram

A database table schema diagram, showing how the shipping tables are related to each other and the location tables.
Table and columns names are defined using their internal names.

General Shipping Setup Notes

Below are some general notes to consider when setting up and managing the shipping tables.

  • All shipping rates must always be based on the carts internal currency, regardless of whether the customer is viewing prices in a different currency.
  • When defining the minimum and maximum cart value and weights for shipping option rates, ensure the minimum and maximum values are not the same, otherwise the shipping rate will not be selected.
    Example: If the minimum and maximum weight both equal '100' the only way that rate would be selected is if the cart weighs exactly '100'.
  • The minimum and maximum cart values are based on the non discounted total of items in the cart.
  • If no shipping options match the customers current shipping location, then the carts default shipping option will be selected.

Shipping Options Table

Contains data on the available shipping options.
The table contains names and descriptions, shipping locations, tax rates and discount inclusion settings for each shipping option.
It does not include the shipping rates (prices) of each option, this data is held in the shipping rates table.


Table and Column Setup
Help
Internal Name Default Name Data Type Description
table shipping_options - The tables name.
id ship_id int The tables primary key.
name ship_name string The name of the shipping option.
description ship_description string A description of the shipping option.
location ship_location_fk int Relates the shipping option 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 ship_zone_fk int Relates the shipping option 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.
inc_sub_locations ship_inc_sub_locations bool Defines whether the shipping option should allow other shipping options related to less specific locations to be displayed.
Example: A users location is 'New York' and shipping options exist for 'United States' and 'New York'.
If sub locations are included, the shipping options for both locations would be available, otherwise, only the 'New York' options would be available.
tax_rate ship_tax_rate int The tax rate to be applied to the shipping option.
Shipping options with no tax rate set use the carts current tax rate.
discount_inclusion ship_discount_inclusion bool Defines whether discounts can be applied to the current shipping option.
Example: A 10% discount is applied to the cart, if the shipping option is excluded from discounts, the shipping price would not be discounted.
status ship_status bool Defines the status of whether the shipping option is active or disabled.
Disabled records will not be used by flexi cart functions.
default ship_default bool Defines the default shipping option to be applied to the cart when first loaded.
A table row defined as the default shipping option 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 and the 'Shipping Rates' table must be enabled too.

If the 'default' column is disabled, the cart will use the default shopping options defined via the config file.

The related location tables do not need to be enabled to use shipping tables.

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

$config['database']['shipping_options']['table'] = 'shipping_options';
$config['database']['shipping_options']['columns']['id'] = 'ship_id';

// Defining the 'default' column.
$config['database']['shipping_options']['default'] = 'ship_default';
// Example #2 : Disabling the table.

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

Shipping Rates Table

Contains the shipping rates (prices) for each shipping option.
The rates can be set into tiers, that alter the rate of the shipping option depending on the total weight and value of the order.

Table and Column Setup
Help
Internal Name Default Name Data Type Description
table shipping_rates - The tables name.
id ship_rate_id int The tables primary key.
parent ship_rate_ship_fk int Relates the shipping rate to a shipping option, so it will only be used by flexi cart functions if that shipping option is set.
The value acts as a foreign key relating the table to the primary key of the shipping options table.
value ship_rate_value int Sets the monetary value of the shipping rate tier.
tare_weight ship_rate_tare_wgt int The weight of the packaging required for the shipping rate tier.
The tare weight is then added to the cart weight when comparing the minimum and maximum weights of shipping rate tiers.
min_weight ship_rate_min_wgt int The minimum cart weight required to activate the shipping rate tier.
max_weight ship_rate_max_wgt int The maximum cart weight permitted to activate the shipping rate tier.
min_value ship_rate_min_value int The minimum cart value (price) required to activate the shipping rate tier.
max_value ship_rate_max_value int The maximum cart value (price) permitted to activate the shipping rate tier.
status ship_rate_status bool Defines the status of whether the shipping rate tier is active or disabled.
Disabled records will not be used by flexi cart functions.
Requirements

If the table is enabled, then all columns are required and the 'Shipping Options' table must be enabled too.

The related location tables do not need to be enabled to use shipping tables.

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

$config['database']['shipping_rates']['table'] = 'shipping_rates';
$config['database']['shipping_rates']['columns']['id'] = 'ship_rate_id';
// Example #2 : Disabling the table.

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

Defining Shipping Defaults via the Config File.

Default shipping options 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 shipping database tables are not enabled.
If shipping tables are enabled, the default shipping option can be defined by entering the value '1' into the row of the tables 'default' column.

Default shipping settings set via the config file are only used if no default value has been set in the shipping option database table.


Default Settings
Parameter Name Data Type Description
id string | int Sets the id of the default shipping option.
name string Sets the name of the default shipping option.
description string Sets the description of the default shipping option.
value int Sets the value (price) of the default shipping option.
tax_rate int Sets the tax rate percentage of the default shipping option.
Set FALSE to use the carts tax rate.
Notes

The default shipping location can be set via the 'Location Config Setup' page.

Example
// Example #1 : Defining default shipping values set via the config file.

$config['defaults']['shipping']['id'] = 1;
$config['defaults']['shipping']['name'] = 'Example Default Shipping Option';
$config['defaults']['shipping']['description'] = 'Example Description';
$config['defaults']['shipping']['value'] = 4.95; // £4.95
$config['defaults']['shipping']['tax_rate'] = 10; // 10%
// Example #2 : Disabling default shipping values set via the config file.

$config['defaults']['shipping']['id'] = 0;
$config['defaults']['shipping']['name'] = FALSE;
$config['defaults']['shipping']['description'] = FALSE;
$config['defaults']['shipping']['value'] = 0;
$config['defaults']['shipping']['tax_rate'] = FALSE;