Admin Location Functions
Location Function Index |
Location Config |
Get Location Session Data |
Get Location Helper Data |
Set Location Session Data
Help with Admin 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.
get_db_location_type()
Gets records from the location type table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
get_db_location_type(sql_select, sql_where)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_select |
string | array |
No |
FALSE |
Define the database fields returned via an SQL SELECT statement.
Read the defining SQL documentation for further information.
|
sql_where |
string | int | array |
No |
FALSE |
Set the SQL WHERE statement used to filter the database records to return.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL SELECT statement on the 'Location Type' table.
By default, the SQL statement is NOT joined to the 'Locations' table, but can be by using flexi carts 'Query Builder - SQL JOIN' function.
The query can be customised by submitting 'sql_select' and 'sql_where' data to the functions parameters.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
This function can be chained with CodeIgniters query functions 'result()', 'row()' etc.
Read the Query Result documentation for further information on all the combined flexi cart and CodeIgniter functions that are available.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:object
Example
$sql_select = array(...);
$sql_where = array(...);
$this->flexi_cart_admin->get_db_location_type($sql_select, $sql_where)->result();
insert_db_location_type()
Inserts a new record to the location type table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
insert_db_location_type(sql_insert)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_insert |
array |
Yes |
FALSE |
Set the SQL INSERT statement used to insert data into the database.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL INSERT statement on the 'Location Type' table, inserting data defined via the 'sql_insert' parameter.
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | id of the inserted record.
Example
$sql_insert = array(...);
$this->flexi_cart_admin->insert_db_location_type($sql_insert);
update_db_location_type()
Updates records in the location type table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
update_db_location_type(sql_update, sql_where)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_update |
array |
Yes |
FALSE |
Set the SQL UPDATE statement used to update data into the database.
Read the defining SQL documentation for further information.
|
sql_where |
string | int | array |
No |
FALSE |
Set the SQL WHERE statement used to filter the database records to update.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL UPDATE statement on the 'Location Type' table, updating data defined via the 'sql_update' parameter and filtered via the 'sql_where' parameter.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | The number of affected rows.
Example
$sql_update = array(...);
$sql_where = array(...);
$this->flexi_cart_admin->update_db_location_type($sql_update, $sql_where);
delete_db_location_type()
Deletes records from the location type table, and if defined, all related child records.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
delete_db_location_type(sql_where, delete_children)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_where |
string | int | array |
Yes |
FALSE |
Set the SQL WHERE statement used to filter the database records to delete.
Read the defining SQL documentation for further information.
|
delete_children |
string |
No |
FALSE |
Define whether to delete all related child records in all cart tables sitewide.
As a precaution, 'delete' must be submitted to delete child records.
Read the information below highlighting the dangers of this parameter.
|
How it Works
The function runs an SQL DELETE statement on the 'Location Type' table filtered via the 'sql_where' parameter.
IMPORTANT: Beware of the dangers of the 'delete_children' parameter.
If 'delete' is submitted to the parameter, the function will delete all related locations, but then also delete all sub-locations, shipping options, item shipping, tax, item tax and discounts that are related to the location, and then all shipping rates that are related to the deleted shipping options.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | The number of affected rows.
Example
$sql_where = array(...);
$this->flexi_cart_admin->delete_db_location_type($sql_where);
get_db_location()
Gets records from the location table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
get_db_location(sql_select, sql_where)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_select |
string | array |
No |
FALSE |
Define the database fields returned via an SQL SELECT statement.
Read the defining SQL documentation for further information.
|
sql_where |
string | int | array |
No |
FALSE |
Set the SQL WHERE statement used to filter the database records to return.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL SELECT statement on the 'Locations' table.
By default, the SQL statement is NOT joined to the 'Location Type' or 'Location Zone' table, but can be by using flexi carts 'Query Builder - SQL JOIN' function.
The query can be customised by submitting 'sql_select' and 'sql_where' data to the functions parameters.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
This function can be chained with CodeIgniters query functions 'result()', 'row()' etc.
Read the Query Result documentation for further information on all the combined flexi cart and CodeIgniter functions that are available.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:object
Example
$sql_select = array(...);
$sql_where = array(...);
$this->flexi_cart_admin->get_db_location($sql_select, $sql_where)->result();
insert_db_location()
Inserts a new record to the location table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
insert_db_location(sql_insert)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_insert |
array |
Yes |
FALSE |
Set the SQL INSERT statement used to insert data into the database.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL INSERT statement on the 'Locations' table, inserting data defined via the 'sql_insert' parameter.
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | id of the inserted record.
Example
$sql_insert = array(...);
$this->flexi_cart_admin->insert_db_location($sql_insert);
update_db_location()
Updates records in the location table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
update_db_location(sql_update, sql_where)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_update |
array |
Yes |
FALSE |
Set the SQL UPDATE statement used to update data into the database.
Read the defining SQL documentation for further information.
|
sql_where |
string | int | array |
No |
FALSE |
Set the SQL WHERE statement used to filter the database records to update.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL UPDATE statement on the 'Locations' table, updating data defined via the 'sql_update' parameter and filtered via the 'sql_where' parameter.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | The number of affected rows.
Example
$sql_update = array(...);
$sql_where = array(...);
$this->flexi_cart_admin->update_db_location($sql_update, $sql_where);
delete_db_location()
Deletes records from the location table, and if defined, all related child records.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
delete_db_location(sql_where, delete_children)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_where |
string | int | array |
Yes |
FALSE |
Set the SQL WHERE statement used to filter the database records to delete.
Read the defining SQL documentation for further information.
|
delete_children |
string |
No |
FALSE |
Define whether to delete all related child records in all cart tables sitewide.
As a precaution, 'delete' must be submitted to delete child records.
Read the information below highlighting the dangers of this parameter.
|
How it Works
The function runs an SQL DELETE statement on the 'Locations' table filtered via the 'sql_where' parameter.
IMPORTANT: Beware of the dangers of the 'delete_children' parameter.
If 'delete' is submitted to the parameter, the function will delete all related sub-locations, but then also delete all shipping options, item shipping, tax, item tax and discounts that are related to the location, and then all shipping rates that are related to the deleted shipping options.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | The number of affected rows.
Example
$sql_where = array(...);
$this->flexi_cart_admin->delete_db_location($sql_where);
get_db_location_zone()
Gets records from the location zone table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
get_db_location_zone(sql_select, sql_where)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_select |
string | array |
No |
FALSE |
Define the database fields returned via an SQL SELECT statement.
Read the defining SQL documentation for further information.
|
sql_where |
string | int | array |
No |
FALSE |
Set the SQL WHERE statement used to filter the database records to return.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL SELECT statement on the 'Location Zones' table.
By default, the SQL statement is NOT joined to the 'Location Type' or 'Locations' table, but can be by using flexi carts 'Query Builder - SQL JOIN' function.
The query can be customised by submitting 'sql_select' and 'sql_where' data to the functions parameters.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
This function can be chained with CodeIgniters query functions 'result()', 'row()' etc.
Read the Query Result documentation for further information on all the combined flexi cart and CodeIgniter functions that are available.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:object
Example
$sql_select = array(...);
$sql_where = array(...);
$this->flexi_cart_admin->get_db_location_zone($sql_select, $sql_where)->result();
insert_db_location_zone()
Inserts a new record to the location zone table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
insert_db_location_zone(sql_insert)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_insert |
array |
Yes |
FALSE |
Set the SQL INSERT statement used to insert data into the database.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL INSERT statement on the 'Location Zones' table, inserting data defined via the 'sql_insert' parameter.
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | id of the inserted record.
Example
$sql_insert = array(...);
$this->flexi_cart_admin->insert_db_location_zone($sql_insert);
update_db_location_zone()
Updates records in the location zone table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
update_db_location_zone(sql_update)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_update |
array |
Yes |
FALSE |
Set the SQL UPDATE statement used to update data into the database.
Read the defining SQL documentation for further information.
|
sql_where |
string | int | array |
No |
FALSE |
Set the SQL WHERE statement used to filter the database records to update.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL UPDATE statement on the 'Location Zones' table, updating data defined via the 'sql_update' parameter and filtered via the 'sql_where' parameter.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | The number of affected rows.
Example
$sql_update = array(...);
$sql_where = array(...);
$this->flexi_cart_admin->update_db_location_zone($sql_update, $sql_where);
delete_db_location_zone()
Deletes records from the location zone table.
Library and Requirements
Available via the admin library only.
Requires all location database tables to be enabled.
Function Parameters
delete_db_location_zone(sql_where)
Help
Name |
Data Type |
Required |
Default |
Description |
sql_where |
string | int | array |
Yes |
FALSE |
Set the SQL WHERE statement used to filter the database records to delete.
Read the defining SQL documentation for further information.
|
How it Works
The function runs an SQL DELETE statement on the 'Location Zones' table filtered via the 'sql_where' parameter.
Notes
This function is compatible with flexi carts 'Query Builder' functions.
If an int value is submitted to the 'sql_where' parameter, the function will automatically match the value against the tables primary key.
Example: If 'sql_where' is submitted as an int of '101', the SQL WHERE statement will be "WHERE 'primary_key_column' = 101
".
Return Values
Failure:FALSE | An error message will be set if a required table/feature is disabled.
Success:int | The number of affected rows.
Example
$sql_where = array(...);
$this->flexi_cart_admin->delete_db_location_zone($sql_where);