Page 1 of 1
Default contact form showing text value in boxes?
Posted: Tue Jun 14, 2022 5:27 am
by msklut
The default contact form is showing "name" in the text field when it should be blank. In the code for /catalog/view/theme/default/template/information/contact.twig it shows "value = " {{ name }}", which is correct. Any ideas what's causing this?
Code: Select all
<input type="text" name="name" value="{{ name }}" id="input-name" class="form-control" />
See screenshot below:
OpenCart 3.0.2.0
Re: Default contact form showing text value in boxes?
Posted: Tue Jun 14, 2022 6:45 pm
by paulfeakins
Seems like it's not being processed by twig properly.
Re: Default contact form showing text value in boxes?
Posted: Tue Jun 14, 2022 7:58 pm
by by mona
Code: Select all
<input type="text" name="name" value="{{ name }}" id="input-name" class="form-control" />
is not correct code for catalog/controller/information/contact.php
Re: Default contact form showing text value in boxes?
Posted: Tue Jun 14, 2022 10:32 pm
by msklut
by mona wrote: ↑Tue Jun 14, 2022 7:58 pm
Code: Select all
<input type="text" name="name" value="{{ name }}" id="input-name" class="form-control" />
is not correct code for catalog/controller/information/contact.php
This is the correct file path, sorry for the confusion.
/catalog/view/theme/default/template/information/contact.twig
Re: Default contact form showing text value in boxes?
Posted: Tue Jun 14, 2022 11:13 pm
by JNeuhoff
How is it that posters here refuse to provide sufficient details when asking for help?
The screenshot shows that it is not a standard OpenCart. Some modifications were done it, and without more details or URL nobody will be able to help here. A standard OpenCart 3.0.3.8 does not have this issue, hence it's likely an extension bug, in which case it might also be a good idea to contact the extension author.
Re: Default contact form showing text value in boxes?
Posted: Tue Jun 14, 2022 11:43 pm
by msklut
The screenshot shows that it is not a standard OpenCart. Some modifications were done it, and without more details or URL nobody will be able to help here. A standard OpenCart 3.0.3.8 does not have this issue, hence it's likely an extension bug, in which case it might also be a good idea to contact the extension author.
Using OC 3.0.2.0 (mentioned at the bottom of the original post). The only change is with styling/css, otherwise it's the same code for the contact.twig file. Regarding the 'name' text, refer to the code in /catalog/view/theme/default/template/information/contact.twig. There is no extension being used with the contact form.
Code: Select all
<input type="text" name="name" value="{{ name }}" id="input-name" class="form-control" />
Re: Default contact form showing text value in boxes?
Posted: Tue Jun 14, 2022 11:49 pm
by straightlight
msklut wrote: ↑Tue Jun 14, 2022 11:43 pm
The screenshot shows that it is not a standard OpenCart. Some modifications were done it, and without more details or URL nobody will be able to help here. A standard OpenCart 3.0.3.8 does not have this issue, hence it's likely an extension bug, in which case it might also be a good idea to contact the extension author.
Using OC 3.0.2.0 (mentioned at the bottom of the original post). The only change is with styling/css, otherwise it's the same code for the contact.twig file. Regarding the 'name' text, refer to the code in /catalog/view/theme/default/template/information/contact.twig. There is no extension being used with the contact form.
Code: Select all
<input type="text" name="name" value="{{ name }}" id="input-name" class="form-control" />
There are only very few users who created incident requests in the past on the forum about this issue while using the "name". However, this issue is not a frequent thing. One way to test this out would be from your developers kit > console tab and notice if there are any errors showing. Take note that errors that may be shown may not reflect to others whereas other users may not be impacted with this particular issue.
Re: Default contact form showing text value in boxes?
Posted: Wed Jun 15, 2022 12:25 am
by sw!tch
As previously mentioned this doesn’t looks like a standard OC contact form.
Are you logged in? If logged in OC will pull the customers first name, perhaps you are using a test account?
https://github.com/opencart/opencart/bl ... t.php#L112
Otherwise possibly something with auto-complete, try a different browser and see if you get the same.
-
Re: Default contact form showing text value in boxes?
Posted: Wed Jun 15, 2022 12:38 am
by JNeuhoff
It's easy enough to figure it out. The controller catalog/controller/information/contact.php uses this:
Code: Select all
if (isset($this->request->post['name'])) {
$data['name'] = $this->request->post['name'];
} else {
$data['name'] = $this->customer->getFirstName();
}
Hence, unless logged in, it won't return 'name'. instead it would return an empty string. If it doesn't then somewhere your code got modified.