aimeos / ai-typo3

TYPO3 adapter for Aimeos web shops and e-commerce solutions
https://aimeos.org/TYPO3
GNU Lesser General Public License v3.0
72 stars 6 forks source link

Wouldn't fe_users.country be easier #26

Closed jonaseberle closed 2 years ago

jonaseberle commented 3 years ago

I wonder why aimeos-typo3 adds static_info_country field to fe_users (3-letter).

https://github.com/aimeos/ai-typo3/blob/0df652a04659edbc0ee110603525d1ab1799cf52/lib/custom/config/mshop/customer.php#L605

Wouldn't it make sense to use the field that EXT:frontend provides (2-letter)? https://github.com/TYPO3/TYPO3.CMS/blame/62e46dd30be1f214ff0d32bdde3a5c5c5bfa70a6/typo3/sysext/frontend/ext_tables.sql#L58

I got the impression that aimeos does not actually use or need 3-letter country codes.

My use case

I have users register through EXT:femanager. They already select their country upon registering and it gets saved (2-letter) into fe_users.country. When they start an aimeos order, the country is not prefilled, though. Couldn't we facilitate that somehow?

aimeos commented 2 years ago

The country column was meant to be the country name (VARCHAR(40)), so EXT:frontend seems to redefine the column. If that would be common sense across all TYPO3 extensions, it would be no problem to use that in Aimeos (we already did that with the language column in the meantime).

As a temporary workaround, you can change the Aimeos SQL statements for INSERT/UPDATE/SELECT to use the country column instead of the static_info_country column for the country code

jonaseberle commented 2 years ago

Thanks. That makes sense. The fe_users.country is just a freetext field that could hold any kind of format (or none at all...)