Jump to content

guardar datos de formulario en variable


Recommended Posts

Hola, estoy creando un modulo para guardar los códigos postales en una base de datos, el dato que quiero guardar se encuentra en /themes/default-bootstrap/address.tpl, el ID y name del campo es 'postcode', el nombre y ID del boton es ''submitAddress' y el codigo que tengo es este 

 

if (Tool::isSubmit('submitAddress')) { 

            $postcode1 = Tools::getValue('postcode');

             configuration::updateValue('LRpostalcode', $postcode1);
            echo'<script type="text/javascript">
             alert("Tarea Guardada");
             window.location.href="index.php";
             </script>';
        }

 

¿alguien sabe porque no funciona? ni siquiera me muestra el alert que puse :(

Link to comment
Share on other sites

Yo utilizaría este hook "actionValidateCustomerAddressForm"

https://devdocs.prestashop.com/1.7/modules/concepts/hooks/list-of-hooks/

actionValidateCustomerAddressForm
This hook is called when a customer submit its address form
Located in: /classes/form/CustomerAddressForm.php

Parameters:

<?php
array(
  'form' => (object) CustomerAddressForm
);

Leeria el codigo postal y ejecutaria tu codigo

 

Edited by gusman126 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...