crustydod Posted April 16, 2019 Share Posted April 16, 2019 Well hello, I have a simple module and I want to get a value from a custom field on the AdminOrders page. The value from the field is not saved anywhere and does not exist in any of the tables and should not. So, back office has additional field: <input type="text" name="custom_field" id="custom_field" class="form-control fixed-width-lg pull-left" value=""/> In override/controllers/admin/AdminOrdersController.php: class AdminOrdersController extends AdminOrdersControllerCore { //... public function postProcess() { if (Tools::isSubmit('submitCustomField')) { // Just to see if it catches it.. File created. file_put_contents( 'test1', 'See me?' ); // The value is of course not fetched. File created. file_put_contents( 'test2', json_encode( Tools::getValue('custom_field') ) ); } } Why doesn't it work? Even better solution would be to get this value in the hook "actionSetInvoice". Tried all things I can think of in the hook too but does not work. So, after 3 hours of googling and reading and testing... how on earth do you get a custom field value on submit in back office or in the hook? PS version: latest Link to comment Share on other sites More sharing options...
crustydod Posted April 17, 2019 Author Share Posted April 17, 2019 Because Generate Invoice button is a link.. Had to change it to a form. 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