THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


good morning,
I have a problem: I have added a new field to the customer table (and schema.xml), but I don't know how to re-create the model...Is  there a command to do this ( es. php app/console propel:model:build )?
Thanks a lot...
Paolo

Offline


You should not change the Thelia model to add a new field to a table. Instead, write a module which manage these fields in its own table.


OpenStudio Toulouse

Offline


ok , thanks for the quick response . I took your advice , but I don't understand how can I integrate the new module in the customer backend form.
Is there a detailed guide to do this (or an example)? thank you very much
Paolo

Offline


You can integrate new fields in the customer backend using hooks.

Please see Thelia documentation for details: http://doc.thelia.net/


OpenStudio Toulouse

Offline


Hello,

You can have a look to this module which adds a field "Date of birth" to the customer register form, it might help you smile

Offline


Thanks for your help. I have followed the advice of etienne 63.
I have two questions about the plugin:
1. I don't understand why the date field appears twice within the customer edit form (the first time under email field, the second time under the password field). I would like to show it only once.....
2. how can I recover the data entered via the plugin in the orders report (OrderExport.php)?

Thank you very much, your advice are very important for me

Paolo

Offline


Which Thelia version do you use ? This module should only be used with version 2.2 which fixes some problems with forms.

I'm currently adding a loop to recover data.

Offline


I 'm using 2.2.0 Thelia

Offline


The loop is done, available in the master development version.

That's strange, check in your database in the "module_hook" table if you don't have a duplicated "hook_id" where "classname" is customerbirthdate.hook

Offline


I installed the plugin on a new installation of Thelia 2.2.0 but the result is always the same: the date field appears twice
IMG

the "module_hook" table has the following hook:
hook

Thanks

Offline


Oh yes I remember, that's because of an error in the template, the password div has the same ID as the email one !
This will be fixed in Thelia 2.2.1, which should be released this week or at the beginning of the next one.
If you can't wait, you can fix it by setting "password" instead of "email" like that : https://github.com/thelia/thelia/commit … b7d184d03a
But remove the modification before updating in 2.2.1 to avoid conflicts

Offline


Perfect, I fixed the error following your advise. Thanks al lot!!!
Now I have one last thing to understand. How can I integrate the orders export (.csv) recovering the information recorded in the customer_birth_date table?

Thank you very much

Offline


Well you can't easily add some columns into actual export tool, you'll have to make your own export module to get customer data AND there birth date.

Offline


ok, can I use some plugins (eg . tinybutstrong) or similar, through which I can use a query directly?

Offline


In order to get it integrated to Thelia, you should follow the documentation and have a look to existing export files to create it.

Offline


thanks , I have decided to use the method linked to export data.

csv

thanks for the support
Paolo