News:

Looking for documentation? Take a look on our wiki

Main Menu

Modify the Ask a Question Form With Overrides

Started by cmb, February 06, 2016, 21:38:07 PM

Previous topic - Next topic

cmb

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