• Welcome to KonaKart Community Forum. Please login or sign up.
 

Best way to add properties to the application

Started by DaveO, August 23, 2010, 11:29:21 pm

Previous topic - Next topic

DaveO

I need to add some custom properties to the application (URLs, IDs, etc...) and I am wondering what the best way to do this is. Is there a build-in mechanism for this or should I just add a new properties file and load it somehow when the application starts?

Thanks!

ming

If you want these to be configuration variables in the database you can add these with a little SQL - see the konakart_demo.sql scripts for examples.

Here's an example for convenience:


INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Warn of Duplicate SKUs', 'ADMIN_APP_WARN_OF_DUPLICATE_SKUS', 'false', 'Issue warning in Admin App of duplicate SKUs', '21', '32', 'choice(\'true\', \'false\')', now());


Note that if you do this these will automatically appear to the KonaKart Admin Application for subsequent modification.

Just make sure you set the configuration_group_Id to the group that's most relevant and almost as if by magic ( :o) your new config variales will appear in the same panels as the others in that Group.

Naturally, you will then be able to access these config variables using the KonaKart APIs from your code.

DaveO


DaveO

One more question - is it also possible to add a new configuration group for my custom properties and have it show up as a menu item?

Thanks

Brian