P
P
papakota2020-01-22 08:05:41
VirtueMart
papakota, 2020-01-22 08:05:41

How do I remove the requirement to fill in a text field when submitting a form?

Hello!
I have the latest version of Joomla and VirtueMart 3. There is an "Ask a question about a product" button on the product page.
The form window pops up. For me, it's useless. I need only contacts of the client (site visitor). There is a text field (rectangular box) that is required. Otherwise, the form cannot be submitted at all. As I understand it, control over this is assigned to the components/com_virtuemart/controllers/productdetails.php file.
Here is a shared access to this PHP file:
https://cloud.mail.ru/public/4R5G/576VCjoW1
I am attaching a screenshot and a link to a live site . It is, however, in English. lang. But I changed the names of the words in my Russian site, but it doesn't matter. The principle is the same. Here is the link:
https://www.profilecreations.co.za/index.php/produ...
5e27d823ac84a304834066.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Kim, 2020-01-22
@kimono

<input type="text" name="contact" required />

A
Ainur Shakirov, 2020-01-22
@Fqyeh29

Or disable this form in the plugin / template settings or, if there is no such setting, you will have to go into the code, remove it from the template

required
and from the handler check for this field.

A
AUser0, 2020-01-22
@AUser0

papakota , And if you are given an atomic bomb, will you blow it up to destroy all these ... well, stupid talker-advisers?
They wrote to you once <input type="text" name="contact" required />, then the second answer was also about required . To add one to the other, and understand that you need to remove the word required in the line <input type="text" name="contact" required />- you don’t need a lot of mind. Well, no more than for barking at these stupid... Well, you understand who, right? Not dumb right?
And here is where you will now look for the text <input type="text" name="contact" required />(and it is not in the given productdetails.php file ) - no one will help you, all the stupid ones will be offended and will pass by. If you spit into the crowd, the crowd will disappear. And if the crowd spits at you...
Although what am I teaching you, you're not stupid.

P
papakota, 2020-01-23
@papakota

To empty talkers and wannabe programmers from our Russia... I myself decided everything without your unfortunate "freelancers"
At first I was completely suffocated by the box'a question and its counter of letters (characters) here:
components/com_virtuemart/views/askquestion/tmpl /form.php
And then I solved the problem with passing the control by the number of letters in the components/com_virtuemart/controllers/productdetails.php file like this:
As a result, I received a form with only NAME, EMAIL and PHONE + captcha.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question