gsmiley007 Posted January 11, 2010 Share Posted January 11, 2010 Hi I'm trying to modify an addon and I can't figure out how Os commerce assigns database entries to variables? Ie How do I use the variable: STORE_OWNER_EMAIL_ADDRESS? The file is in a subdirectory ie /catalog/newmod/ Thanks Quote Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 12, 2010 Author Share Posted January 12, 2010 Hi I tried the line, but I get: Notice: Use of undefined constant STORE_OWNER_EMAIL_ADDRESS I want to display the email in an html page. So I'm trying to understand how to retrieve values from the database. I would like to use other values in the database as well. <?php echo STORE_OWNER_EMAIL_ADDRESS; ?> and you will see the email address of the store owner, assuming he has inserted it in his admin area under configuration. What exactly do you want to do with it? Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted January 12, 2010 Share Posted January 12, 2010 Hi I'm trying to modify an addon and I can't figure out how Os commerce assigns database entries to variables? Ie How do I use the variable: STORE_OWNER_EMAIL_ADDRESS? The file is in a subdirectory ie /catalog/newmod/ Thanks This is not a database entry it is what is called a define. example .. define( 'MY_TEST', 'I am a test' ); The above allows me to do <?php echo MY_TEST; ?> and what is actually printed to screen is "I am a test" If you look in the languages files (catalog/includes/languages/) you will see loads of these. If you ever wonder in osCommerce what a capitalised string seperated by underscores is .. it is a define. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
gsmiley007 Posted January 12, 2010 Author Share Posted January 12, 2010 Is there a function that calls database entries? Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted January 12, 2010 Share Posted January 12, 2010 Rob - incorrect, very rarely! This is a database entry, please see the configuration table, configuration id #3 Ooops too late, too tired, too tipsy. :) @gsmiley007 In the configuration table of the database are also these capitalised strings with underscores, These are defined at run time in application by the following code .. // set the application parameters $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.