Post by msklut » Tue Jun 14, 2022 5:27 am

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:
Image

OpenCart 3.0.2.0
Last edited by msklut on Tue Jun 14, 2022 10:31 pm, edited 1 time in total.

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by paulfeakins » Tue Jun 14, 2022 6:45 pm

Seems like it's not being processed by twig properly.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by by mona » 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

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by msklut » Tue Jun 14, 2022 10:32 pm

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

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by JNeuhoff » Tue Jun 14, 2022 11:13 pm

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.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by msklut » 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" />

New member

Posts

Joined
Tue Nov 19, 2019 11:43 pm
Location - Charlotte, NC

Post by straightlight » Tue Jun 14, 2022 11:49 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by sw!tch » Wed Jun 15, 2022 12:25 am

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.

-

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by JNeuhoff » Wed Jun 15, 2022 12:38 am

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.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: 7cswinery and 70 guests