This Function Has Been Available Since:
(AFCommerce v 2.1, Functions v 1.1)
Description
afc_check_for_config_value ( varname )
This function adds a new variable to the "config" database table (if it doesn't already exist). This function is mainly used by me to check if your store has a certain field when I add new features. I will be adding a lot of new free features this year, as well as, all of my add ons. This function saves me a lot of extra lines of code, so I made it to do this simple task for me. You can use it if you want, but generally when your adding features to your own site, you can just add a new row in the table manually, instead of needing to write a script to call this function. It's up to you of course, it's here if you need it.
DO NOT EDIT THIS FUNCTION UNLESS YOU ADD FIELDS TO THE CONFIG TABLE, WHICH YOU SHOULD NEVER HAVE A REASON TO DO ANYWAY. I ONLY LEFT THIS FUNCTION OPEN SOURCE IN CASE FOR SOME REASON YOU NEEDED TO ADD MORE FIELDS TO THE CONFIG TABLE, BUT IF YOU DID ADD FIELDS HERE, YOU MAY MAKE NEW FREE FEATURES NOT WORK CORRECTLY. THIS FUNCTION IS VERY SIMPLE AND IS HERE SO THAT WHENEVER THERE IS AN UPGRADE, THE CART CAN CHECK IF A VARIABLE EXISTS IN THE CONFIG TABLE AND IF IT DOES NOT EXIST, IT ADDS THE VALUE FOR YOU EASILY. SO IF YOU CHANGE THE CONFIG TABLE'S STRUCTURE, YOUR DOING THAT AT YOUR OWN RISK, AND WILL HAVE TO MANUALLY FIX ANY CONFLICTS IT CAUSES WITH YOUR CHANGES. BOTTOM LINE IS THAT YOU SHOULD NOT CHANGE THE STRUCTURE OF THE CONFIG TABLE, AND IF YOUR NOT EXTREMELY SKILLFUL WITH BOTH PHP AND MYSQL, DO NOT MODIFY ANY OF THE DEFAULT AFCOMMERCE TABLES, CREATE YOUR OWN TABLES TO AVOID CONFLICTS WITH MINE.
Parameters
varname (string) - This is the name of the variable that you want to add to the config database table (if it doesn't already exist).
Return Values
This function has no return value.
Open Source: YesPaul's Examples // make sure a new variable (maybe needed for an upgraded feature) is available
afc_check_for_config_value ("new_variable");
|
Back to Functions List
|