Skip to main content

Posts

Showing posts from November, 2018

How to edit the settings in Opencart 2.x (php)

IMPORTANT NOTE: editSetting() will Delete ALL the previous settings. Usually in opercart it's used in the configuration page to get all the data in one "post" request. This sample is for the module 'accountdisabler' - replace 'accountdisabler' with your own module name. Also the key string (ex. 'accountautodisabler_days' ) must start with your module name. //Loading the model $this->load->model('setting/setting'); //setting data for our module $aadata = array('accountautodisabler_days' => '60'); //editing $this->model_setting_setting->editSetting('accountautodisabler', $aadata); In this example it saves data for the main/first store ( with id 0 ).  An example to store multiple multiple values that are serialized in the database //Loading the model $this->load->model('setting/setting'); //setting data for our module $aadata = array('accountautodisabler_days' =>