Post by haosmark » Mon Dec 31, 2012 1:30 pm

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?

New member

Posts

Joined
Wed Oct 10, 2012 1:59 am

Post by rph » Mon Dec 31, 2012 3:03 pm

haosmark wrote:1) Where is the data stored when I save settings? Is it in DB under a special table?
It's stored in the settings table. You have six columns:

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.
2) How do I unset previously set values?
Like so:

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);
 
Note that there's no way to edit/delete just one value. It's all or nothing for every value in the group.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by haosmark » Mon Dec 31, 2012 11:23 pm

Thank you for a helpful answer :)

New member

Posts

Joined
Wed Oct 10, 2012 1:59 am
Who is online

Users browsing this forum: No registered users and 8 guests