Extending the registration

Hello fellow OXIDians,

I have another question which might be a little tricky to answer. At registration, we need to add an additional field “Where did you hear about us?” to the registration form. Adding the field is dead easy by either modifying register.tpl or user.tpl… but how can I get OXID to store this value in the database along with all the other user details?

I assume I will have to create some sort of module and extend/override the register::registeruser() methods or one of its inherited parent methods. The thing is… I have no idea how. I’ve looked through the code and can’t actually find the point where OXID writes to the database. Has anyone done this before and is willing to give me a few pointers?

Thanks and regards

Dave

Hi,

simply add to you database new fields and clean the tmp folder
after that you can use in templates yours new variable oxuser__newfiledname

Hi wanis,

i have got the same problem: want to extend registration form with a must-have-field ‘confirm age’.

Database-field is already set up (named OXCHECKAGE), template is extended with an lableled checkbox and in admin-area oxuser__oxcheckage was defined as must-have. I cleaned up the tmp-folder and oxidshop tells me to fill out all must-have-fields - which is absolutely correct and fine.
BUT: oxid does not recognize the new checkbox-field in the registration-form and because of that, I can’t send any registration due to missing must-have-fields (error-message).

How do I setup a checkbox-field defined as must-have in the template? any idea?
currently it looks like this:


<input type="checkbox" name="invadr[oxuser__oxcheckage]" value="[{if $oxcmp_user->oxuser__oxcheckage->value }]1[{else}]0[{/if}]" [{if $oxcmp_user->oxuser__oxcheckage->value }]checked[{/if}]> 
                    <b>...some text...</b><span class="req">*</span>

Thanks for any hint!