Post by hobbykit » Sat Nov 07, 2020 12:34 pm

I want to create a custom field. I want a Company ID (or VAT) to be entered when registering or changing an address. I did it, but it gives me an error:
"Fatal error: Cannot use string offset as an array in ../admin/view/template/sale/customer_form.tpl on line 501"
I use OpenCart 2.0.1.1
Where is my mistake?

New member

Posts

Joined
Sat Jan 11, 2020 3:50 pm

Post by JNeuhoff » Sat Nov 07, 2020 7:10 pm

hobbykit wrote:
Sat Nov 07, 2020 12:34 pm
Where is my mistake?
By not giving us enough details to be able to help you.

You started changing files, but didn't tell us what exactly you did to your files.

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 hobbykit » Sat Nov 07, 2020 9:31 pm

I'm not changing files.
I added a new field from the OpenCart administrator, "Sales - Customers - Customs fields". I added a new field "Company ID".
In "Register Account", the field is filled in. No problem.
However, in "Edit Consumer" from the OpenCart administrator, "Address1", this error appears below the "Company ID" field:
"Fatal error: Cannot use string offset as an array in ../admin/view/template/sale/customer_form.tpl on line 501"

Let me explain what I want to do if anyone can give an idea.
I want the user to choose a private person or company when registering or Edit / New address.
If a company, user must enter the Company ID (or VAT Number). This information should be published on Order in the email.
I hope I explained correctly. And this for OpenCart 2.0.1.1

New member

Posts

Joined
Sat Jan 11, 2020 3:50 pm

Post by kestas » Sun Nov 08, 2020 6:03 am

hobbykit wrote:
Sat Nov 07, 2020 9:31 pm

If a company, user must enter the Company ID (or VAT Number). This information should be published on Order in the email.
I hope I explained correctly. And this for OpenCart 2.0.1.1
This custom field data is not sent by email by default and is not shown on the invoice...

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by IP_CAM » Sun Nov 08, 2020 6:14 am


My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by hobbykit » Sun Nov 08, 2020 2:11 pm

I did a few sample. When the new field is in Location - Account there is no problem. But when it is in Location - Address, there is an error. OpenCart 2.0.1.1
What could be the problem?

New member

Posts

Joined
Sat Jan 11, 2020 3:50 pm

Post by straightlight » Sun Nov 08, 2020 6:22 pm

Custom fields have been fixed on the master branch already. I would suggest to take a look at the validate() and validateForm() methods from the controllers and integrate those fixes. You could also look on the Marketplace for similar fixes.

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 paulfeakins » Mon Nov 09, 2020 7:22 pm

hobbykit wrote:
Sun Nov 08, 2020 2:11 pm
I did a few sample. When the new field is in Location - Account there is no problem. But when it is in Location - Address, there is an error. OpenCart 2.0.1.1
What could be the problem?
Sounds like you'd save time by posting a paid job here Commercial Support Forum.

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


User avatar
Guru Member
Online

Posts

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

Users browsing this forum: Semrush [Bot] and 114 guests