Author Topic: product inquiry additional field  (Read 309 times)

yableh

  • Beginner
  • *
  • Posts: 4
product inquiry additional field
« on: July 10, 2018, 17:51:08 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26973
  • Always on vacation
    • Jenkin Hill Internet
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM..3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31


yableh

  • Beginner
  • *
  • Posts: 4
Re: product inquiry additional field
« Reply #3 on: July 10, 2018, 19:07:40 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3331
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: product inquiry additional field
« Reply #4 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

yableh

  • Beginner
  • *
  • Posts: 4
Re: product inquiry additional field
« Reply #5 on: July 11, 2018, 02:12:54 am »
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