Author Topic: How to add Custom Fields to "Ask A Question../Call for Price" ??  (Read 12565 times)

Jovi007

  • Beginner
  • *
  • Posts: 18
I would like to know how to add custom fields to the forms provided for "Call for Price" and "Ask a Question about Product".

Namely, I'd like to add fields such as Company Name, Phone Number, Country, etc.

I was able to accomplish this in the earlier version of VirtueMart, but cannot find the files needed in the VM2.

If anyone knows how or can point me in the right direction, IT WILL BE GREATLY APPRECIATED!

Thank you in advance,

Carlos

Jovi007

  • Beginner
  • *
  • Posts: 18
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #1 on: July 17, 2012, 18:16:12 pm »
I am still in need of this help. If anyone can provide me with the information it would be GREATLY APPRECIATED!

Thank you!

Carlos

Engholm

  • Beginner
  • *
  • Posts: 28
    • pixeldiele mediendesign
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #2 on: August 22, 2012, 10:46:02 am »
I have the same request. Any ideas for this?

Regards,
Engholm

tvver

  • Beginner
  • *
  • Posts: 1
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #3 on: September 05, 2012, 03:57:43 am »
I could really use some help on this too. Anyone? Anyone?

ptfeplastics

  • Beginner
  • *
  • Posts: 3
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #4 on: September 05, 2012, 09:50:04 am »
I also have this problem,anyone could help us?

molenwal1

  • Beginner
  • *
  • Posts: 3
    • Molenwal1 Webdesign
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #5 on: September 11, 2012, 07:50:52 am »
As is do not want to hack in the VM core code, i have solved it this way to add a phone field:
Copy from directory components/com_virtuemart/views/askquestion the files form.php and mail_html_question.php to your template in html/com_virtuemart/askquestion.

In form.php changed the form to:
Code: [Select]
<form method="post" class="form-validate" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id.'&tmpl=component') ; ?>" name="askform" id="askform">

  <label><?php echo JText::_('COM_VIRTUEMART_USER_FORM_NAME')  ?> : </label><input type="text" class="validate[required,minSize[4],maxSize[64]]" value="<?php echo $this->user->name ?>" name="name" id="name" size="30"  validation="required name"/>
   <br /><br />
  <label><?php echo JText::_('COM_VIRTUEMART_USER_FORM_EMAIL')  ?> : </label><input type="text" class="validate[required,custom[email]]" value="<?php echo $this->user->email ?>" name="email" id="email" size="30"  validation="required email"/>
  <br/><br />
  <label><?php echo JText::_('COM_VIRTUEMART_SHOPPER_FORM_PHONE')  ?> : </label><input type="text" class="validate[required,custom[phone]]" value="<?php echo $this->phone ?>" name="phone" id="phone" size="30"  validation="required phone"/>
  <br/><br />
  <label>
    <?php
    $ask_comment 
JText::sprintf('COM_VIRTUEMART_ASK_COMMENT'$min$max);
    echo 
$ask_comment;
    
?>

    </label>
  <br />
  <textarea title="<?php echo $ask_comment ?>" class="validate[required,minSize[<?php echo $min ?>],maxSize[<?php echo $max ?>]] field" id="comment" name="comment" rows="10"></textarea>

  <div class="submit">
    <input class="highlight-button" type="submit" name="submit_ask" title="<?php echo JText::_('COM_VIRTUEMART_ASK_SUBMIT')  ?>" value="<?php echo JText::_('COM_VIRTUEMART_ASK_SUBMIT')  ?>" />

    <div class="width50 floatright right paddingtop">
      <?php echo JText::_('COM_VIRTUEMART_ASK_COUNT')  ?>
       <input type="text" value="0" size="4" class="counter" id="counter" name="counter" maxlength="4" readonly="readonly" />
    </div>
  </div>

  <input type="hidden" name="virtuemart_product_id" value="<?php echo JRequest::getInt('virtuemart_product_id',0); ?>" />
  <input type="hidden" name="tmpl" value="component" />
  <input type="hidden" name="view" value="productdetails" />
  <input type="hidden" name="option" value="com_virtuemart" />
  <input type="hidden" name="virtuemart_category_id" value="<?php echo JRequest::getInt('virtuemart_category_id'); ?>" />
  <input type="hidden" name="task" value="mailAskquestion" />
  <?php echo JHTML::_'form.token' ); ?>
</form>


In mail_html_question.php at start:
Code: [Select]
<?php
defined
('_JEXEC') or die('');
$this->phone JRequest::getString ('phone');
?>

And this:
Code: [Select]
<td valign="top" width="100%">
    <?php
   
echo JText::sprintf('COM_VIRTUEMART_QUESTION_MAIL_FROM'$this->user['name']) . "<br />";
   echo 
JText::_('COM_VIRTUEMART_USER_FORM_EMAIL') . " : " $this->user['email'] . "<br />";
   echo 
JText::_('COM_VIRTUEMART_SHOPPER_FORM_PHONE') . " : " $this->phone "<br />";
   echo 
$this->comment"<br />";
  
?>

</td>

Webdesign, Joomla, Virtuemart, Webshop, Webhosting, SEO

vega55

  • Beginner
  • *
  • Posts: 13
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #6 on: March 06, 2015, 04:42:57 am »
file upload?
Code: [Select]
<td><label><?php echo JText::_('COM_VIRTUEMART_FILES_FORM_FILE')  ?> : </label></td>
<td><input type="file" class="validate[required,custom[file]]" value="<?php echo $this->user->file ?>" name="file" id="file" size="30"  validation="required file"/></td>
</tr>

jqv:custom rule not found file error

please help

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27426
  • Always on vacation
    • Jenkin Hill Internet
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #7 on: March 06, 2015, 11:21:09 am »
What? This is a 2 year old thread so what has your problem to do with that obviously old VM version?
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.3.10057 on Joomla 3.9.8 PHP 7.0.33
Testing VM .3.6.0.10075 on Joomla 3.9.8

vega55

  • Beginner
  • *
  • Posts: 13
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #8 on: March 06, 2015, 23:52:15 pm »
VirtueMart version: 2.6.4

file upload form
form error : "jqv:custom rule not found file"

form php

Code: [Select]
<td><label><?php echo JText::_('COM_VIRTUEMART_FILES_FORM_FILE')  ?> : </label></td>
<td><input type="file" class="validate[required,custom[file]]" value="<?php echo $this->user->file ?>" name="file" id="file" size="30"  validation="required file"/></td>
</tr>

mail_html_question.php

Code: [Select]
<tr>
<td align="center" style="border-bottom : 1px solid #dad8d8;">
<span style="font-size: 14px; font-weight: bold"><?php echo JText::sprintf('COM_VIRTUEMART_QUESTION_MAIL_FROM'$this->user['name'], $this->user['email']); ?></span>

<br /><br /><?php echo $this->file"<br />";
<br /><br /><?php echo $this->comment?>
<br /><br />
</td>
</tr>

mail_raw_question.php

Code: [Select]
<?php
defined
('_JEXEC') or die('');

echo 
JText::sprintf('COM_VIRTUEMART_WELCOME_VENDOR'$this->vendor->vendor_store_name) . "\n" "\n";
echo 
JText::_('COM_VIRTUEMART_QUESTION_ABOUT') . ' '$this->product->product_name;
if (
$this->product->product_sku) echo ' ('.JText::_('COM_VIRTUEMART_PRODUCT_SKU').' '.$this->product->product_sku .')' ;
echo 
"\n" "\n";
echo 
JText::sprintf('COM_VIRTUEMART_QUESTION_MAIL_FROM'$this->user->name$this->user->email) . "\n";
echo 
$this->file"\n";
echo 
$this->comment"\n";

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27426
  • 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.3.10057 on Joomla 3.9.8 PHP 7.0.33
Testing VM .3.6.0.10075 on Joomla 3.9.8

vega55

  • Beginner
  • *
  • Posts: 13
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #10 on: March 07, 2015, 01:10:26 am »
VirtueMart 2.9.9b

The problem continues

file upload form
form error : "jqv:custom rule not found file"
 :-[ :-[ :-[ :-[ :-[ :-[

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8892
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: How to add Custom Fields to "Ask A Question../Call for Price" ??
« Reply #11 on: March 07, 2015, 02:02:23 am »
Quote
VirtueMart 2.9.9b

a non stable test version for pre release VM3??????

what's wrong with using the current VM3.0.6.2?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation