- Posts: 71
- Thank you received: 0
Duplicate Custom field on registration
12 years 5 months ago #151723
by vaughan
Duplicate Custom field on registration was created by vaughan
-- url of the page with the problem -- :
wpb.es
-- Joomla version -- : 3.1
-- PHP version -- : 5.4
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message
Hi
How can i do to duplicate a custom field in 2 tables?
I have a custom field in table address "address_vat" (required in registration) and a custom field in user table "vat_number"
I want when a customer submit the registration form, the field address_vat is copied in vat_number (I do this to serach the customer better in backend)
I try with this code in mysql and works
but i don´t know in what field i must insert this code.
Note: I have restricted only 1 direction per customer
Coul you help me?
thanks
-- Joomla version -- : 3.1
-- PHP version -- : 5.4
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message
Hi
How can i do to duplicate a custom field in 2 tables?
I have a custom field in table address "address_vat" (required in registration) and a custom field in user table "vat_number"
I want when a customer submit the registration form, the field address_vat is copied in vat_number (I do this to serach the customer better in backend)
I try with this code in mysql and works
Code:
UPDATE nnj0c_hikashop_user, nnj0c_hikashop_address SET nnj0c_hikashop_user.vat_number=nnj0c_hikashop_address.address_vat WHERE nnj0c_hikashop_user.user_id=nnj0c_hikashop_address.address_user_id
Note: I have restricted only 1 direction per customer
Coul you help me?
thanks
Please Log in or Create an account to join the conversation.
12 years 5 months ago #151762
by Xavier
Replied by Xavier on topic Duplicate Custom field on registration
Hi,
You have to create a plugin based on the triggers "onAfterUserCreate(&$element)" and "onAfterUserUpdate(&$element)", by this way when the customer register or update his infos the request is executed and update the desired field.
Here is some documentation about that:
www.hikashop.com/support/support/documen...umentation.html#user
You have to create a plugin based on the triggers "onAfterUserCreate(&$element)" and "onAfterUserUpdate(&$element)", by this way when the customer register or update his infos the request is executed and update the desired field.
Here is some documentation about that:
www.hikashop.com/support/support/documen...umentation.html#user
Please Log in or Create an account to join the conversation.
Time to create page: 0.164 seconds