Jump to content

Link to contact page with id_contact


Recommended Posts

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

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.

  • Thanks 1
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...