How to extend fe_user on order and confirm email

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

How to extend fe_user on order and confirm email

Post by mantik » 18 Dec 2018, 08:14

Hello
I like some fields more for the user. aimeos creates new user on order so how can i set some additional fields there?
I like alos to send a verificationmail for his email.(like femanager).

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

Re: How to extend fe_user on order and confirm email

Post by aimeos » 18 Dec 2018, 22:23

mantik wrote:I like some fields more for the user. aimeos creates new user on order so how can i set some additional fields there?
You can add fields to the billing address template prefixed with "cs_extra" whose names and values will be passed to the fromArray() method of your customer manager in the account sub-client:
- https://github.com/aimeos/ai-client-htm ... d.php#L227
- https://github.com/aimeos/ai-client-htm ... d.php#L230
mantik wrote:I like alos to send a verificationmail for his email.(like femanager).
That's actually not part of Aimeos because it only creates the account. You should use femanager if you need that feature for new users.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Re: How to extend fe_user on order and confirm email

Post by mantik » 19 Dec 2018, 08:21

But how can i hook in the creation of Account and do that?
The Problem is if aimeos create the user then femenagaer is useless. femanager is just for creating the user.

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

Re: How to extend fe_user on order and confirm email

Post by aimeos » 20 Dec 2018, 08:32

You can add a decorator that executes required actions after addItem() of the customer controller was called:
https://github.com/aimeos/ai-controller ... rd.php#L31
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

SupportMantik
Posts: 5
Joined: 09 Jan 2019, 08:07

Re: How to extend fe_user on order and confirm email

Post by SupportMantik » 09 Jan 2019, 13:33

Hello,

I want to add some additional fields in address billing template. I will set up them as hidden field in template.
Problem is that the fields I want to add isn't fields of aimeos.customer.

I have extend my fe_user with te field additional_data. How can i now fill this field be the in cs_extra array on user creation

P.S. I add that fields to table fe_users with my own extension.

Thanks

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

Re: How to extend fe_user on order and confirm email

Post by aimeos » 10 Jan 2019, 10:43

The cs_extra key/value pairs are also passed to the customer frontend controller:
https://github.com/aimeos/ai-client-htm ... d.php#L230

There, they are passed via fromArray() to the customer item:
https://github.com/aimeos/ai-controller ... rd.php#L31

Thus, you only have to extend the customer item with get/set methods and an extended fromArray/toArray method and overwrite the saveItem() method of the customer manager.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Re: How to extend fe_user on order and confirm email

Post by mantik » 10 Jan 2019, 17:16

hmmm is there a A- z example how to do that updatesafely?

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

Re: How to extend fe_user on order and confirm email

Post by aimeos » 11 Jan 2019, 10:36

Yes, here's the relevant article from the documentation:
https://aimeos.org/docs/Developers/Libr ... gers_items

Like always, add your own code to a project specific Aimeos (TYPO3) extension so you will be save for updates
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Re: How to extend fe_user on order and confirm email

Post by mantik » 12 Jan 2019, 08:37

Hello i got an Error here an this step:

Code: Select all

    return [

        'product' => [

            'manager' => [

                'name' => 'Myproject',

                'standard' => [

                    'search' => [

                        'ansi' => 'SELECT ... (with new column)',

                    ],

                ],

            ],

        ],

    ];
So i add this just for testing (to be sure that the configuration works an catch.):

Code: Select all

return array(
	'manager' => array(
        'name'=>'Mantikcustomer1',
        'address'=>array(
	        'name'=>'Mantikcustomer2',
	    ),
        'group'=>array(
            'name'=>'Mantikcustomer3',
        ),
        'lists'=>array(
            'name'=>'Mantikcustomer4',
        ),
        'property'=>array(
            'name'=>'Mantikcustomer5',
        ),
        'standard' => array(
            'name'=>'Mantikcustomer6',
        ),
    ),
);
So in the Listview of jQadmin nothing..., if i open i got an error for the configuration lists, group and property (thats ok because there is no class Mantikcustomer1-6. So the error is good. I see now that the configuration go search my classes.

My problem ist why address dosent care? and the bigger problem is why standard dosent care (mantikcustomer1 and mantikcustomer6).

I like to add new fields to jqAdmin so i want the new field in the customer list view but cus my own manager dosent catch i got an error for the setters/getter-methods.

i think to work in the list one of this configurations must work

Code: Select all

	'manager' => array(
        'name'=>'Mantikcustomer1',
        'standard' => array(
            'name'=>'Mantikcustomer6',
        ),
    ),
but it dosent do. (no error that class not exists even when i exept this error).
Dont understand me wrong: no error is good :) but i do it like this to check the configurationhandling.

so result: 3 time it works, 3 time not -> same synthax.... :/

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

Re: How to extend fe_user on order and confirm email

Post by aimeos » 14 Jan 2019, 13:32

Your configuration doesn't match in your examples. The first is for the product manager, the second for the customer domain and its submanagers. Please post one example that shows the problem and describe only that problem instead of mixing up several things.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply