News:

Looking for documentation? Take a look on our wiki

Main Menu

product inquiry additional field

Started by yableh, July 10, 2018, 17:51:08 PM

Previous topic - Next topic

yableh

Hi,

Please i need to add a field to Product inquiry popup. (VirtueMart 3.2.14)

For now we can only get the Name and The E-mail but i need get the Phone number also, this field will not be mandatory.

someone can help me?

Thank you

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum


yableh

I tried with no luck. I was able to display the phone field, but the phone number does not appear in the mail

Studio 42

You need to add entered phone in /components/com_virtuemart/views/askquestion/tmpl/mail_html_question.php
or better do an override in your template

yableh

Quote from: Studio 42 on July 10, 2018, 23:08:51 PM
You need to add entered phone in /components/com_virtuemart/views/askquestion/tmpl/mail_html_question.php
or better do an override in your template

Thank you but still receive only Name and E-mail.

I add those lines in com_virtuemart/views/askquestion/view.html.php:

$phonenumber = vRequest::getVar ('phone', '');
$phonenumber = str_replace (array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $phonenumber);
$this->user->phone = $phonenumber;

Then in templates/my_template/html/com_virtuemart/askquestion/form.php ( i am using joomla / vm template from Gavick)

<tr>
      <td><label for="phone"><?php echo vmText::_('COM_VIRTUEMART_USER_FORM_PHONE')  ?> : </label></td>
      <td><input type="text" class="validate[required,custom[phone]]" value="<?php echo $this->user->phone ? $this->user->phone : $sessData['phone'] ?>" name="phone" id="phone" size="30"  validation="required phone"/></td>
   </tr>


Then in /components/com_virtuemart/views/askquestion/tmpl/mail_html_question.php

$this->user->phone