JohnKS Posted March 30 Share Posted March 30 (edited) So I'm trying to create a prestashop module that gets the value of fields in the hookDisplayAdminProductsExtra however I am not gettnig any values. I belive the problem is the submit method not being executed. Hook Function Quote public function hookDisplayAdminProductsExtra() { if (Tools::isSubmit("submitextra")) { $fileName = "newfile.txt"; $txt = "SUBMIT\n"; $myfile = fopen($fileName, "w") or die("Unable to open file!"); if (fwrite($myfile, $txt) === false) { echo "Unable to write to file!"; } else { echo "Data written to file successfully!"; } fclose($myfile); } return $this->display(__FILE__, "views/templates/hook/displayAdminExtra.tpl"); } <form method='POST'> <h1>{$id_product}</h1> <label for="extra">Extra Info</label> <input type="text" name='extra' class="form-control"> <input type="hidden" name="id_product" value="{$id_product}"> <input type="submit" value="Guardar" name="submitextra"> </form> TPL File Edited March 30 by JohnKS (see edit history) Link to comment Share on other sites More sharing options...
Paul C Posted March 31 Share Posted March 31 That hook is just maintained for backwards compatibility. Here's an example module to add fields to the (symphony) product page:https://github.com/PululuK/democustomfields17 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