User Guide | Getting Reward Point and Voucher Session Data

When the flexi cart library is first loaded, an array is automatically created that is setup to match the carts default settings, this data is then stored in the browsers session. All items and settings that are then later added and altered within the cart are updated to the carts session data.

The data within the carts session can then be accessed and in many cases, formatted and customised using the large range of functions that are available from the lite and standard libraries.

Get Reward Point and Voucher Session Data

Reward Function Index | Reward Config | Get Reward Helper Data | Reward Admin Data

Help with 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.

reward_voucher_status()

Return whether any reward vouchers have been applied to the cart.


Library and Requirements

Available via the lite, standard and admin libraries.

Does not require any database tables to be enabled.

Return Values

Not Applied:FALSE

Applied:TRUE

Examples
Note: The returned example values below are displaying live data from the current cart session data.
reward_voucher_status() Are any reward vouchers applied to the cart? bool(false)

reward_voucher_data()

Returns an array of all reward voucher values and descriptions.


Library and Requirements

Available via the lite, standard and admin libraries.

Does not require any database tables to be enabled.

Function Parameters
reward_voucher_data(format, internal_value) Help
Name Data Type Required Default Description
format bool No TRUE Define whether to format the returned monetary values as currencies.
internal_value bool No FALSE Defines whether to return the monetary values using the carts internal currency instead of the users current currency.
Return Values

Failure:array (Empty)

Success:array

Examples
Note: The returned example values below are displaying live data from the current cart session data.
reward_voucher_data(TRUE, TRUE) Display the current value and description for all set reward vouchers. Show / Hide Array
Array
(
)
reward_voucher_data(TRUE, FALSE) Display the internal value and description data for all set reward vouchers. Show / Hide Array
Array
(
)

reward_voucher_description()

Returns reward voucher values and descriptions formatted as a string.


Library and Requirements

Available via the lite, standard and admin libraries.

Does not require any database tables to be enabled.

Function Parameters
reward_voucher_description(value_prefix, suffix_delimiter, internal_value) Help
Name Data Type Required Default Description
value_prefix string No FALSE Defines a string of characters to separate the reward voucher description and value.
If no 'value_prefix' is set, the reward voucher value will be omitted from the returned description.
prefix_delimiter string No FALSE Defines a string of characters to prefix to the start of each reward voucher description.
suffix_delimiter string No <br/> Defines a string of characters to suffix to the end of each reward voucher description.
internal_value bool No FALSE Defines whether to return the monetary values using the carts internal currency instead of the users current currency.
Return Values

Failure:FALSE

Success:string

Examples
Note: The returned example values below are displaying live data from the current cart session data.
reward_voucher_description(FALSE, FALSE, '<br/>', FALSE) Format the reward voucher description with a line break after each row and the value omitted. bool(false)
reward_voucher_description('@&nbsp;', '<p>', '</p>', FALSE) Format the reward voucher description with a prefixed space and '@' sign between the description and current value, and with each row wrapped in a html <p> tag. bool(false)
reward_voucher_description('@&nbsp;', '<p>', '</p>', TRUE) Format the reward voucher description with a prefixed space and '@' sign between the description and internal value, and with each row wrapped in a html <p> tag. bool(false)