prestashop_newuser Posted September 30, 2013 Share Posted September 30, 2013 Hi, I am doing a small module. In that I am fetching some data from the database in hook. The code for hook is like this, in this I just want to assign the value of public function hookHome($params) { $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); global $cookie, $smarty; $value=array(); $sql_select="SELECT * FROM "._DB_PREFIX_."storeinfo WHERE status = '1'"; $value=Db::getInstance()->ExecuteS($sql_select); // print_r($value); $smarty->assign('array',$value); $smarty->assign('default',$defaultLanguage); return $this->display(__FILE__, 'storeinfo.tpl'); } In view file (storeinfo.tpl) I want to show the values thats why I just made {$array|@print_r} in storeinfo.tpl but it did not showed anything. Now If I am doing print_r($value) in the public function hookHome($params) {} I am getting the array. But the assigned values in smarty is not showing in .tpl file so can someone kindly tell me what is the problem here..Any help and suggestions will be really appreciable. Thanks Link to comment Share on other sites More sharing options...
vekia Posted September 30, 2013 Share Posted September 30, 2013 can you insert {$debug} in your .tpl file and then - you will see popup with all available variables your $array variable appears there? or it doesn't exist at all? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now