Counya Posted May 22, 2022 Share Posted May 22, 2022 (edited) Hi everyone, I'm currently blocked on this problem to add more fields to my contact form (sorry it's in French) the second field is the field I want to add, I add on the table ps_customer_thread when the user send the message. But when I send the message I don't have the order number in my db, I change the CustomerThread.php, contactform.php and contactform.tpl but nothing change... I add my field at the end of the CustomerThread public static $definition = [ 'table' => 'customer_thread', 'primary' => 'id_customer_thread', 'fields' => [ 'id_lang' => [ 'type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true, ], 'id_contact' => [ 'type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true, ], 'id_shop' => [ 'type' => self::TYPE_INT, 'validate' => 'isUnsignedId', ], 'id_customer' => [ 'type' => self::TYPE_INT, 'validate' => 'isUnsignedId', ], 'id_order' => [ 'type' => self::TYPE_INT, 'validate' => 'isUnsignedId', ], 'id_product' => [ 'type' => self::TYPE_INT, 'validate' => 'isUnsignedId', ], 'email' => [ 'type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 255, ], 'token' => [ 'type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, ], 'status' => [ 'type' => self::TYPE_STRING, ], 'date_add' => [ 'type' => self::TYPE_DATE, 'validate' => 'isDate', ], 'date_upd' => [ 'type' => self::TYPE_DATE, 'validate' => 'isDate', ], 'nborder' => [ 'type' => self::TYPE_STRING, 'validate' => 'isGenericName', ], ], ]; I write : $nborder = trim(Tools::getValue('nborder')); On my function sendMessage() '{nborder}' => Tools::nl2br(Tools::htmlentitiesUTF8(Tools::stripslashes($nborder))), and var_list on contactform.php And add one input in my contactform.tpl <div class="form-group row"> <label class="col-md-3 form-control-label" for="nbcommande">N° de commande</label> <div class="col-md-6"> <input id="nbcommande" class="form-control" name="nborder" type="text" value="{$contact.nborder}" placeholder="Ton numéro de commande" > </div> </div> I followed lot of tutorial but nothing works... I hope someone has the solution to my problem, thank you in advance Have a good night/day Edited May 22, 2022 by Counya (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted May 22, 2022 Share Posted May 22, 2022 there are many modules to do this now, see https://addons.prestashop.com/en/search?search_query=forms for dev questions please post in developers section, this is for general questions. 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