Post by redactuk » Wed Jun 26, 2024 6:43 pm

Question related to upgrade from v2 to OC v4.0.2.3

When converting data from previous versions, in oc_order we now have payment_address_id and shipping_address_id.

1. As far as I can see, not creating these IDs does not cause any issues for historical orders. Is this correct?

2. Does anyone have a handy bit of SQL that can be used to query address table and assign these IDs?

Thanks

New member

Posts

Joined
Thu Jan 05, 2012 1:09 am

Post by softmonke » Thu Jun 27, 2024 9:04 pm

redactuk wrote:
Wed Jun 26, 2024 6:43 pm
Question related to upgrade from v2 to OC v4.0.2.3

When converting data from previous versions, in oc_order we now have payment_address_id and shipping_address_id.

1. As far as I can see, not creating these IDs does not cause any issues for historical orders. Is this correct?

2. Does anyone have a handy bit of SQL that can be used to query address table and assign these IDs?

Thanks
Yes, from what I understand, the address_id column in order table for OpenCart 4 is not required, you can just set it to 0.

For reconciling address IDs with the actual addresses, you could probably just run a SQL query to match all fields, i.e. address_1, address_2, country_id, city, zone_id, etc. But there could also be a possibility that addresses have duplicates so it could return multiple IDs as well. I would suggest to just ignore the address id.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by redactuk » Fri Jun 28, 2024 4:41 pm

Thanks for reply.

Yes, we've done some further testing and nothing seems to break if ID is not present.
As you suggest, we'll write some SQL at some point to see if we can populate them.

New member

Posts

Joined
Thu Jan 05, 2012 1:09 am
Who is online

Users browsing this forum: No registered users and 2 guests