waterp Posted May 28, 2020 Share Posted May 28, 2020 Hi, is there anyway to point to a contact page but specifying the id_contact in the form? Something like mysite/contact-us?id_contact=3 Link to comment Share on other sites More sharing options...
PrestaServicePro Posted May 28, 2020 Share Posted May 28, 2020 Hello. Please, could you explain more detailed? 1 Link to comment Share on other sites More sharing options...
waterp Posted May 28, 2020 Author Share Posted May 28, 2020 Sure. At the contact page link you'll find a form with some contacts as drop down items, I wonder if using an url variable I can't see at that page webmaster as default for example. Actually what you can do with message variable url to pass the message text variable in the form. That's clearer? Link to comment Share on other sites More sharing options...
waterp Posted June 3, 2020 Author Share Posted June 3, 2020 Any idea? It isn't possible? Link to comment Share on other sites More sharing options...
PrestaServicePro Posted June 4, 2020 Share Posted June 4, 2020 Hello. If i understand right, the contact name must be selected if there is id_contact value added to URL. I have did it. Please, check code below and my steps: 1) File: folder of PS > modules > contactform > contactform.php. Line: 281 or Function: function renderWiidget() if (Tools::getValue('id_contact')) { $contactVal = Tools::getValue('id_contact'); $this->smarty->assign('contact_id', $contactVal); } Add this code above: $this->smarty->assign($this->getWidgetVariables($hookName, $configuration)); 2) File: folder of PS > theme > current_theme_folder > modules > contactform > views > templates > widget > contactform.tpl. Line: 50 or <select name="id_contact" class="form-control form-control-select"> <option value="{$contact_elt.id_contact}">{$contact_elt.name}</option> change it to <option value="{$contact_elt.id_contact}" {if $contact_id eq $contact_elt.id_contact} selected {/if}>{$contact_elt.name}</option> Save the files and check. 1 Link to comment Share on other sites More sharing options...
waterp Posted June 5, 2020 Author Share Posted June 5, 2020 Hi, thanks for your help but it didn't work. You can check it here if you change the id in the url it always shows "aggiungi testimonianza", while I'd like to change the subject using url. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted June 5, 2020 Share Posted June 5, 2020 Try to add this code <option value="{$contact_elt.id_contact}" {if $contact_id eq $contact_elt.id_contact} selected {/if}>{$contact_elt.name}</option> to this path too: modules/contactform/views/templates/widget/contactform.tpl 1 Link to comment Share on other sites More sharing options...
waterp Posted June 5, 2020 Author Share Posted June 5, 2020 Done. It doesn't work. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted June 5, 2020 Share Posted June 5, 2020 It is impossible. I did it in 2 different shops and result was same. Do you let me check it in your shop? 1 Link to comment Share on other sites More sharing options...
waterp Posted June 5, 2020 Author Share Posted June 5, 2020 Sure. Tell me what you need, I'll write you in pvt. 1 Link to comment Share on other sites More sharing options...
PrestaServicePro Posted June 5, 2020 Share Posted June 5, 2020 I can explain over skype. If you have an account, PM me name please. 1 Link to comment Share on other sites More sharing options...
waterp Posted June 5, 2020 Author Share Posted June 5, 2020 I wrote to you on skype Link to comment Share on other sites More sharing options...
PrestaServicePro Posted June 5, 2020 Share Posted June 5, 2020 Thanks. 1 Link to comment Share on other sites More sharing options...
PrestaServicePro Posted June 5, 2020 Share Posted June 5, 2020 Please, mark the topic name as SOLVED 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