Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Custom config values


julian_lp

Recommended Posts

Posted

I would like to know if I can write some custom config variables's names/values from the admin panel (hopefully to the DB). I'm looking forward for a way to not to write some custom admin panel and rather use the supplied with OsCommerce.

 

Those config var's values will be used by my custom code, so, in short words, what I need is:

 

ADMIN > define and write A, B and C values

 

 

STORE > read A, B and C values

 

by the way, is there a specific funtion to retrieve admin config variables?

 

thanks in advance

Posted

many of the contributions you can download do this -- and osc is set up to handle it fairly well. you can define configuration values and add them to an existing configuration group, or a config group of your own.

 

take a look at some of the other contributions, like header tags seo. i know that one creates it's own group.

 

all configuration values are initialized for use inside application_top.php. see this 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']);
 }

 

there's similar code in both the /catalog/includes/application_top.php and the /catalog/admin/includes/application_top.php. so all you have to do is insert the appropriate data into the configuration table..and everything is set up for you. you then, just use the defined value, as specified in the configuration_key column of the table.

Posted

Yes indeed. Another good contribution that does this is FWR Media's SecurityPro. You will probably want to download that one anyway and it's not very big or difficult to do, and helps protect you from the naughty people. So you could download it to see how it adds its own configuration group to the database, with its own variables. You can copy the principle yourself for whatever it is you want to do...

 

Here's the link... Security Pro contribution 5752

Posted

sweet, very usefull

every key=>value in configuration table is indeed defined and ready to use in PHP in any application file,and it's writeable througout the admin panel...

 

thanks a lot to you both

julian

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...