rafapas22 Posted July 14, 2016 Share Posted July 14, 2016 Buenas a todos. Después de darle a guardar al formulario helperform, he puesto para que en el postProcess se guarden los datos en la BBDD y lo hace bien, pero no me sale ningun mensaje de confirmación de Exito en el guardado de la Configuracion, no debería aparecer? no está implementado por defecto? o debo hacer algo.. public static function insertButtonSQL($text,$color) { $sql = 'INSERT INTO `'.pSQL(_DB_PREFIX_).'table` (`campo1`,`campo2`,`campo3`) VALUES ("","'.pSQL($text).'","'.pSQL($color).'")'; $result = Db::getInstance()->execute($sql); } /** * Save form data. */ protected function postProcess() { /*$form_values = $this->getConfigFormValues(); foreach (array_keys($form_values) as $key) { Configuration::updateValue($key, Tools::getValue($key)); }*/ $this->insertButtonSQL(Tools::getValue('value1'),Tools::getValue('value2')); } Link to comment Share on other sites More sharing options...
yorkeso Posted July 14, 2016 Share Posted July 14, 2016 (edited) Buenas, Yo haría algo así como: /** * Save form data. */ protected function postProcess() { /*$form_values = $this->getConfigFormValues(); foreach (array_keys($form_values) as $key) { Configuration::updateValue($key, Tools::getValue($key)); }*/ if ($this->insertButtonSQL(Tools::getValue('value1'),Tools::getValue('value2'))) { return $this->displayConfirmation($this->l('Cambios actualizados')); } return $this->displayError($this->l('Error al guardar)); } Un saludo. Edited July 14, 2016 by yorkeso (see edit history) Link to comment Share on other sites More sharing options...
rafapas22 Posted July 15, 2016 Author Share Posted July 15, 2016 Gracias ya lo solucioné 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