Post by vourlismenos » Wed Jul 16, 2025 8:21 pm

Hi,
working in oc 3.0.3.2 and php 7.4.33
It's a copy of the actual website with a template called nou and several extensions, but they don't really affect this particular modification.

I'm trying to add some extra fields in the delivery address (not billing address).

I've added the first field (as a test) in the delivery address for guest checkout.
Did a test order and I can see the extra field in my database - it's an extra phone number.
So far so good.

I'm now trying to display the extra phone number in the order, in the admin but I must be missing something.
I've edited the order.php for both the controller and model. As far as I can understand the way the delivery address is displayed is from the order.php in the controller - or not?

Any idea what file exactly I have to edit in order to display the extra field in the ordeR?
Last edited by vourlismenos on Thu Jul 17, 2025 3:11 pm, edited 1 time in total.

New member

Posts

Joined
Wed Dec 05, 2018 5:01 pm

Post by ADD Creative » Wed Jul 16, 2025 9:59 pm

The shipping address if formatted for display as at the link below.
https://github.com/opencart/opencart/bl ... #L870-L903

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by vourlismenos » Thu Jul 17, 2025 2:56 pm

yeap.... that's the part I've edited, and still nothing.
So I probably did something wrong.... I'll check again I suppose :/

*** EDIT ***

arghhh.... got it.... It was a typo.
I'm keeping the thread open to post the complete solution, when I'm done, for anyone interested

New member

Posts

Joined
Wed Dec 05, 2018 5:01 pm

Post by vourlismenos » Thu Jul 17, 2025 7:14 pm

ok the order (as a guest) works great.
The extra field is added and displayed in the orders.

My issue now, is when I try to edit the order as an admin.
The extra field is displayed in the edit order form and the entry is there.
But if I save, it disappears. Any additions are not saved in the database.

I've edited so far, admin/view/template/sale/order_Form.twig - admin/model/order/order.php - admin/controller/sale/order.php.

Any other changes are saved, just not the new field.
I've read somewhere order changes go through the front edn: catalog/controller/api/order.php and catalog/model/checkout/order.php
So I've checked these files as well. Still nothing.

Am I missing some other process or should I go look for typos again ??? :-\

New member

Posts

Joined
Wed Dec 05, 2018 5:01 pm

Post by DesignCart » Thu Jul 17, 2025 7:20 pm

Opencart supports additional fields in the order and you don't have to rummage through the files additionally. The information should display automatically. But...if you really want it on the admin side for the order details sale/order.php -> info() and sale/order_info.twig

Tworzenie sklepów internetowych | Portfolio | Cennik | O mnie


User avatar
Active Member

Posts

Joined
Thu Nov 10, 2016 2:06 pm
Location - Gubin

Post by DesignCart » Thu Jul 17, 2025 7:26 pm

It looks like you have removed all permissions for yourself. Check the permission column in phpmyadmin in user_group.

Tworzenie sklepów internetowych | Portfolio | Cennik | O mnie


User avatar
Active Member

Posts

Joined
Thu Nov 10, 2016 2:06 pm
Location - Gubin

Post by vourlismenos » Thu Jul 17, 2025 9:24 pm

The custom fields - for the address in my case - will appear in the billing address.
I just want to display an extra phone field in the shipping address (only). I can't do that through the custom fields.

The information in order_info.twig comes from admin/controller/sale/order.php - I've already fixed that. It was typo.

I have a different issue now, when I'm trying to edit the order through the admin.
DesignCart wrote:
Thu Jul 17, 2025 7:20 pm
Opencart supports additional fields in the order and you don't have to rummage through the files additionally. The information should display automatically. But...if you really want it on the admin side for the order details sale/order.php -> info() and sale/order_info.twig

New member

Posts

Joined
Wed Dec 05, 2018 5:01 pm

Post by ADD Creative » Fri Jul 18, 2025 2:52 am

The shipping address is saved to the session via api/shipping/address. This then get saved via api/order/edit.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: Bing [Bot] and 17 guests