php - How to get values from Prestashop module database -


i have quite simple prestashop module want rework use own database table separate language etc.

previously module writen without multilingual function simple ps_configuration table use.

 public function hookdisplayfooter($params)      {          $value = configuration::get('mymodule_settings'); 

and have

 public function hookdisplayfooter($params)      {          $value = tools::getvalue('mymodule_settings'); 

everything works can't mymodle_settings values in function anymore. input array.

array(     'type' => 'text',     'label' => $this->l('settings'),     'desc' => $this->l('my module settings.'),     'name' => 'mymodule_settings',     'lang' => true,     'size' => 64, ), 

this database table

 `mymodule_settings` varchar(255) not null, 

the mymodule_settings values correctly placed in database , see them in module bo, , question how them function $value =

tools::getvalue returns value stored in $_post / $_get variable not return database entries.

so in case need use db::getinstance(_ps_use_sql_slave_)->getrow(''); function

in case job

public function hookdisplayfooter($params)     {         $sql = 'select mymodule_settings '._db_prefix_.'mymodule';         $value = db::getinstance(_ps_use_sql_slave_)->getrow($sql); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -