User Guide | Setting Cart Config Session Data

Data is set to the cart session by using functions primarily from flexi carts standard library.

The data that can be set in the cart session includes data of items added to the cart, user localisation data and cart configuration settings.

Since many of flexi carts features can be set using either manually submitted data, or data retrieved from the database; there are often two versions of a function to set session data. Functions that update session data using the database are prefixed with the function name 'update_xxx', whilst functions that use manually set data are prefixed with the name 'set_xxx'.

Set Cart Config Session Data

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

Help with Setting Session Data Functions

Show / Hide Help

Name: The name of the function (method).

Data Type: The data type that is expected by the function.

  • bool : Requires a boolean value of 'TRUE' or 'FALSE'.
  • string : Requires a textual value.
  • int : Requires a numeric value. It does not matter whether the value is an integer, float, decimal etc.
  • array : Requires an array.

Required: Defines whether the parameter requires a value to be submitted.

Default: Defines the default parameter value that is used if no other value is submitted.

set_order_number()

Sets an order number to the cart session data.


Function Parameters
set_order_number(order_number) Help
Name Data Type Required Default Description
order_number int Yes FALSE Defines the order number to be set.
Return Values

Failure:FALSE | An error message will be set.

Success:TRUE | A status message will be set.

Example
$order_number = 'example_order_number';

$this->flexi_cart->set_order_number($order_number);

set_minimum_order()

Sets the carts minimum order value.


Function Parameters
set_minimum_order(value) Help
Name Data Type Required Default Description
value int Yes FALSE Defines the minimum order value to be set.
Notes

If no value is submitted, the cart will use the value set in the configuration database table or config file.

Return Values

Failure:FALSE | An error message will be set.

Success:TRUE | A status message will be set.

Example
$minimum_order_value = 10; // £10.00

$this->flexi_cart->set_minimum_order($minimum_order_value);

set_prices_inc_tax()

Sets cart pricing to be displayed including/excluding tax.


Function Parameters
set_prices_inc_tax(tax_status) Help
Name Data Type Required Default Description
tax_status bool No NULL Defines the status.
If no status has been submitted, the current status is toggled.
Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
// Example #1 : Setting a specific status.

$this->flexi_cart->set_prices_inc_tax(TRUE);
// Example #2 : Toggle current status.

$this->flexi_cart->set_prices_inc_tax();

set_allocate_stock_status()

Sets whether item stock should be automatically allocated by cart functions.


Function Parameters
set_allocate_stock_status(allocate_stock_status) Help
Name Data Type Required Default Description
allocate_stock_status bool No NULL Defines the status.
If no status has been submitted, the current status is toggled.
Notes

The primary purpose of this function is to be able to toggle the stock allocation method within a users session, rather than updating the default cart settings that would affect all users.

Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
// Example #1 : Setting a specific status.

$this->flexi_cart->set_allocate_stock_status(TRUE);
// Example #2 : Toggle current status.

$this->flexi_cart->set_allocate_stock_status();

set_stock_limit_quantity_status()

Sets whether the maximum quantity of cart items should be limited to the databases stock quantity.


Library and Requirements

Available via the standard library only.

Requires the item stock database table to be enabled.

Function Parameters
set_stock_limit_quantity_status(stock_limit_quantity_status) Help
Name Data Type Required Default Description
stock_limit_quantity_status bool No NULL Defines the status.
If no status has been submitted, the current status is toggled.
Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
// Example #1 : Setting a specific status.

$this->flexi_cart->set_stock_limit_quantity_status(TRUE);
// Example #2 : Toggle current status.

$this->flexi_cart->set_stock_limit_quantity_status();

set_remove_no_stock_status()

Sets whether out-of-stock items should be automatically removed from the cart.


Function Parameters
set_remove_no_stock_status(remove_no_stock_status) Help
Name Data Type Required Default Description
remove_no_stock_status bool No NULL Defines the status.
If no status has been submitted, the current status is toggled.
Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
// Example #1 : Setting a specific status.

$this->flexi_cart->set_remove_no_stock_status(TRUE);
// Example #2 : Toggle current status.

$this->flexi_cart->set_remove_no_stock_status();

set_item_shipping_ban_status()

Sets whether to save items to an order that are banned from being shipped to the defined shipping location.


Function Parameters
set_item_shipping_ban_status(set_item_shipping_ban_status) Help
Name Data Type Required Default Description
set_item_shipping_ban_status bool No NULL Defines the status.
If no status has been submitted, the current status is toggled.
Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
// Example #1 : Setting a specific status.

$this->flexi_cart->set_item_shipping_ban_status(TRUE);
// Example #2 : Toggle current status.

$this->flexi_cart->set_item_shipping_ban_status();

set_reward_point_multiplier()

Sets the carts reward point multiplier.


Function Parameters
set_reward_point_multiplier(value) Help
Name Data Type Required Default Description
value int No FALSE Defines the minimum order value to be set.
Notes

Example: A multiplier of 10 is (10 x $1.00) = 10 reward points, so every $1.00 is worth 10 reward points.

If no value is submitted, the cart will use the value set in the configuration database table or config file.

Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
$multiplier_value = 10; // 10 points for every £1.00 spent.

$this->flexi_cart->set_reward_point_multiplier($multiplier_value);

set_custom_status_1()

Sets the value of the carts custom status #1.


Function Parameters
set_custom_status_1(custom_status, recalculate_cart) Help
Name Data Type Required Default Description
custom_status bool No NULL Defines the value of the custom status.
recalculate_cart bool No TRUE Define if all cart totals must be recalculated on success, regardless of whether the function has determined to do so or not.
The purpose of this is prevent multiple unnecessary recalculations of the cart if this function is used with other cart updating functions.
Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
$this->flexi_cart->set_custom_status_1('example_value');

set_custom_status_2()

Sets the value of the carts custom status #2.


Function Parameters
set_custom_status_2(custom_status, recalculate_cart) Help
Name Data Type Required Default Description
custom_status bool No NULL Defines the value of the custom status.
recalculate_cart bool No TRUE Define if all cart totals must be recalculated on success, regardless of whether the function has determined to do so or not.
The purpose of this is prevent multiple unnecessary recalculations of the cart if this function is used with other cart updating functions.
Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
$this->flexi_cart->set_custom_status_2('example_value');

set_custom_status_3()

Sets the value of the carts custom status #3.


Function Parameters
set_custom_status_3(custom_status, recalculate_cart) Help
Name Data Type Required Default Description
custom_status bool No NULL Defines the value of the custom status.
recalculate_cart bool No TRUE Define if all cart totals must be recalculated on success, regardless of whether the function has determined to do so or not.
The purpose of this is prevent multiple unnecessary recalculations of the cart if this function is used with other cart updating functions.
Return Values

Failure:n/a

Success:TRUE | A status message will be set.

Example
$this->flexi_cart->set_custom_status_3('example_value');