1) Where is the data stored when I save settings? Is it in DB under a special table?
2) How do I unset previously set values?
It's stored in the settings table. You have six columns:haosmark wrote:1) Where is the data stored when I save settings? Is it in DB under a special table?
setting_id: Just an auto-increment value. Not really used anywhere.
store_id: Apply config value to a specific store if you have multistore set up. Default '0' (default store).
group: An umbrella under which you put like settings. For example 'config' would hold store configuration keys like 'config_error_display' and 'config_use_ssl'. You'll have groups for all kinds of different things like payment method ('cod', 'free_checkout', 'pp_pro' and 'pp_standard' for PayPal), shipping methods ('cod', 'flat', 'ups', 'usps'), and modules ('banner', 'bestseller', 'slideshow').
key: Reference for $this->config->get() e.g. $this->config->get('config_image_popup_width') to get popup image width.
value: Value of the key.
serialized: Whether the config value is serialized (1) or not (0). OpenCart will automatically serialize any array data when you set config values.
Like so:2) How do I unset previously set values?
Code: Select all
// Load /admin/model/setting/setting.php
$this->load->model('setting/setting');
// Delete an entire setting group
// $store_id will default to '0' (default store) if unspecified
$this->model_setting_setting->deleteSetting($group, $store_id);
// Editing a setting will delete all previous group data before writing the new
// $store_id will default to '0' (default store) if unspecified
$this->model_setting_setting->editSetting($group, $data, $store_id);
-Ryan
Who is online
Users browsing this forum: No registered users and 395 guests