Removing 'Create a customer account' and Salutation

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
thepurpleblob
Posts: 20
Joined: 22 Oct 2020, 15:39

Removing 'Create a customer account' and Salutation

Post by thepurpleblob » 08 Nov 2020, 22:29

I'd like to modify the checkout page. I know I can copy the page and change it but I thought I would check if there was a simpler way through the configuration...

I don't want users to register accounts - is there some way to simply disable that feature. I found the page https://aimeos.org/docs/Configuration/C ... d/subparts but I don't really know what it means (I can't get those arrays to do anything).

I also need to change the 'Salutation' field. It doesn't show suitable options. My choices, in order, would be...
1. Make it a simple text field
2. Increase the number of options
3. Take it away completely

While I remember, is there any possibility of having a second address line? Uk addresses can have two lines in "official" addresses.

User avatar
aimeos
Administrator
Posts: 7871
Joined: 01 Jan 1970, 00:00

Re: Removing 'Create a customer account' and Salutation

Post by aimeos » 10 Nov 2020, 09:50

thepurpleblob wrote: 08 Nov 2020, 22:29 I'd like to modify the checkout page. I know I can copy the page and change it but I thought I would check if there was a simpler way through the configuration...

I don't want users to register accounts - is there some way to simply disable that feature. I found the page https://aimeos.org/docs/Configuration/C ... d/subparts but I don't really know what it means (I can't get those arrays to do anything).
You need to remove it from the template nevertheless, so this is the easiest way as nothing will happen any more regarding automatic registration.
thepurpleblob wrote: 08 Nov 2020, 22:29 I also need to change the 'Salutation' field. It doesn't show suitable options. My choices, in order, would be...
1. Make it a simple text field
2. Increase the number of options
3. Take it away completely
The salutation values are checked against the allowed values here, so you can't make it a text field:
https://github.com/aimeos/aimeos-core/b ... #L708-L721

You can either increase the number of options by extending several places in the code or you can remove the field. But if you want to add a possibility for users to enter their title, there's an own field for that available.
thepurpleblob wrote: 08 Nov 2020, 22:29 While I remember, is there any possibility of having a second address line? Uk addresses can have two lines in "official" addresses.
Yes, there are three fields available: address1, address2 and address2
You can change the translation of that fields to match your needs:
https://github.com/aimeos/ai-client-htm ... d.php#L113
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

thepurpleblob
Posts: 20
Joined: 22 Oct 2020, 15:39

Re: Removing 'Create a customer account' and Salutation

Post by thepurpleblob » 10 Nov 2020, 11:25

That's great - thanks for all your help.

thepurpleblob
Posts: 20
Joined: 22 Oct 2020, 15:39

Re: Removing 'Create a customer account' and Salutation

Post by thepurpleblob » 10 Nov 2020, 18:06

I'm struggling with the gettext stuff. I'd never heard of it before (never worked on anything that needed translations).

I'm assuming this is the file? https://github.com/aimeos/ai-client-htm ... i18n/en.po ??

I know that I need to copy it to my extension - however, I can't find the codes for the address or salutation. I tried 'poedit' and it didn't help at all.

Can you tell me where to edit to add/remove these fields?

EDIT:
I'm looking at address-partial-standard.php and can see all the code for the address lines but they are 'display: none' in CSS (somehow). I can't see how all this fits together. Help much appreciated.

User avatar
aimeos
Administrator
Posts: 7871
Joined: 01 Jan 1970, 00:00

Re: Removing 'Create a customer account' and Salutation

Post by aimeos » 11 Nov 2020, 17:04

You can overwrite translations in your Laravel ./config/shop.php too instead of changing the Gettext files:
https://aimeos.org/docs/latest/laravel/ ... anslations

The address fields in the checkout are displayed according to your settings and you can tell Aimeos which fields are mandatory, optional or hidden. Search e.g. for "client html checkout address mandatory" in the Aimeos docs.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply