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

#   PHP generated dropdown as custom field in Hikashop registration

##

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

Less More

- Posts: 41
- Thank you received: 9
-
-

9 years 9 months ago [\#261126](#261126) by [Savickis](/forum/user/26490-savickis "View Savickis's Profile")  *[PHP generated dropdown as custom field in Hikashop registration](/forum/33-customers/888625-php-generated-dropdown-as-custom-field-in-hikashop-registration#261126 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.5.38 -- Browser(s) name and version -- : Chrome 56.0  Hello!  I'm using Hikashop registration form as default way of registration in my Joomla website. It has nice function like ability to add custom fields (especially dropdowns) to registration form.  Now, what I'd like to do, is add additional custom field (dropdown) during registration. This custom field will be called &quot;Refer to member who invited you to join&quot; and it should return dropdown list of already registred members from my Joomla user category called &quot;Old members&quot;. I found the PHP code snippet that allows to return list of members in question (this returns all registred users right now):  But question remains - how to pass this code snippet to Hikashop registration form custom field?  I would be very very thankful if somebody would help me by pointing out, which files should be modified to get expected result. Thanks in advance!")* was created by *[Savickis](/forum/user/26490-savickis "View Savickis's Profile")*

-- HikaShop version -- : 3.0.0
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.5.38
-- Browser(s) name and version -- : Chrome 56.0

Hello!

I'm using Hikashop registration form as default way of registration in my Joomla website. It has nice function like ability to add custom fields (especially dropdowns) to registration form.

Now, what I'd like to do, is add additional custom field (dropdown) during registration. This custom field will be called "Refer to member who invited you to join" and it should return dropdown list of already registred members from my Joomla user category called "Old members". I found the PHP code snippet that allows to return list of members in question (this returns all registred users right now): Code:

$db =&amp; JFactory::getDBO(); $query = "SELECT * FROM #__users" ; $db-&gt;setQuery($query); $rows = $db-&gt;loadObjectList(); foreach ($rows as $row) { echo $row-&gt;id.'&#124;'.$row-&gt;username.'&#124;'.$row-&gt;email; }

But question remains - how to pass this code snippet to Hikashop registration form custom field?

I would be very very thankful if somebody would help me by pointing out, which files should be modified to get expected result. Thanks in advance!

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#261127](#261127) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[PHP generated dropdown as custom field in Hikashop registration](/forum/33-customers/888625-php-generated-dropdown-as-custom-field-in-hikashop-registration#261127 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.5.38 -- Browser(s) name and version -- : Chrome 56.0  Hello!  I'm using Hikashop registration form as default way of registration in my Joomla website. It has nice function like ability to add custom fields (especially dropdowns) to registration form.  Now, what I'd like to do, is add additional custom field (dropdown) during registration. This custom field will be called &quot;Refer to member who invited you to join&quot; and it should return dropdown list of already registred members from my Joomla user category called &quot;Old members&quot;. I found the PHP code snippet that allows to return list of members in question (this returns all registred users right now):  But question remains - how to pass this code snippet to Hikashop registration form custom field?  I would be very very thankful if somebody would help me by pointing out, which files should be modified to get expected result. Thanks in advance!")*

Hi,

I'm afraid that I don't understand what you want to do with the list of all users in your Joomla "users" table.

If you want to create your own custom field ; it is possible to do so thanks to a custom plugin (in the way that it requires a specific development).
There is for example the plugin "datepicker" in HikaShop which is working in such kind of way. It is a plugin but it provide a new type of custom field.

Another solution is to create a "classical" custom field and change how that field is displayed during the registration.
It means that the field will be seen as a simple input box for the rest of the website (like in the backend).
That technique is easier to implement, it just require a view override (but need to target the right view) for the implementation.
The user registration can be done via a page (user / registration) or during the checkout (same view if legacy mode ; checkout / sub_block_login_registration otherwise).

More about customization : [ www.hikashop.com/support/documentation/1...ize-the-display.html](https://www.hikashop.com/support/documentation/153-customize-the-display.html)
More about development in HikaShop (mostly triggers) : [ www.hikashop.com/support/documentation/6...r-documentation.html](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84ODg2MjUtcGhwLWdlbmVyYXRlZC1kcm9wZG93bi1hcy1jdXN0b20tZmllbGQtaW4taGlrYXNob3AtcmVnaXN0cmF0aW9uP3RtcGw9bWFya2Rvd24=) 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.043 seconds

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