[Skip to main content](#vessel-content)

#   Duplicate Custom field on registration

##

- **[vaughan](/forum/user/12479-vaughan "View vaughan's Profile")**
- [![vaughan's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar12479.jpg)](/forum/user/12479-vaughan "View vaughan's Profile") Topic Author
- [ Offline](/forum/user/12479-vaughan)

Less More

- Posts: 71
- Thank you received: 0
-
-

12 years 7 months ago [\#151723](#151723) by [vaughan](/forum/user/12479-vaughan "View vaughan's Profile")  *[Duplicate Custom field on registration](/forum/33-customers/867355-duplicate-custom-field-on-registration#151723 "-- 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&#95;message  Hi  How can i do to duplicate a custom field in 2 tables? I have a custom field in table address &quot;address&#95;vat&quot; (required in registration) and a custom field in user table &quot;vat&#95;number&quot;  I want when a customer submit the registration form, the field address&#95;vat is copied in vat&#95;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")* was created by *[vaughan](/forum/user/12479-vaughan "View vaughan's Profile")*

-- url of the page with the problem -- : [ wpb.es](http://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 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

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NjczNTUtZHVwbGljYXRlLWN1c3RvbS1maWVsZC1vbi1yZWdpc3RyYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 7 months ago [\#151762](#151762) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Duplicate Custom field on registration](/forum/33-customers/867355-duplicate-custom-field-on-registration#151762 "-- 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&#95;message  Hi  How can i do to duplicate a custom field in 2 tables? I have a custom field in table address &quot;address&#95;vat&quot; (required in registration) and a custom field in user table &quot;vat&#95;number&quot;  I want when a customer submit the registration form, the field address&#95;vat is copied in vat&#95;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")*

Hi,

You have to create a plugin based on the triggers "onAfterUserCreate(&amp;$element)" and "onAfterUserUpdate(&amp;$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](http://www.hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html#user)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NjczNTUtZHVwbGljYXRlLWN1c3RvbS1maWVsZC1vbi1yZWdpc3RyYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.056 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
