Author Topic: Modify the Ask a Question Form With Overrides  (Read 538 times)

cmb

  • Jr. Member
  • **
  • Posts: 85
Modify the Ask a Question Form With Overrides
« on: February 06, 2016, 21:38:07 pm »
I'm updating and modifying a VirtueMart version 3.0.12 installation running on a Joomla version 2.5.28 Website.

As part of the upgrade I'm modifying the Ask a Question form to add fields for a company name and telephone number. I have added files to the template's html directory that override /components/com_virtuemart/views/askquestion/tmpl/form.php and /components/com_virtuemart/views/askquestion/tmpl/mail_html_question.php. A problem arises when you try to insert the value of those new fields in the mail_html_question.php file. The values entered by the user are not preserved.

The solution that you'll find here in the forum and elsewhere involves modifying the /components/com_virtuemart/views/askquestion/view.html.php file and adding variables to hold the new values. Unfortunately that file cannot be overridden. My edits might be lost when updating to a future version of VirtueMart. I must avoid core hacks.

What is the best method to get the telephone number and company name from the form and transfer it to the email?

I thought of storing the field values in the session variable. Has anyone used that method?
Charles

m.davide82

  • Jr. Member
  • **
  • Posts: 86
Re: Modify the Ask a Question Form With Overrides
« Reply #1 on: August 01, 2017, 16:16:49 pm »
Anyone had an answer to this?

Thanks a lot!