Jump to content
Sign in to follow this  
gsmiley007

Wanting to modify an addon

Recommended Posts

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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']);
 }

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×