Custom fields for brands; Joomla User integration

  • Posts: 28
  • Thank you received: 0
6 years 2 months ago #303054

-- HikaShop version -- : 4.0.0
-- Joomla version -- : 3.9.2
-- PHP version -- : latest

Hello,

Two questions:
1) Is it possible or will it be possible in the future to have custom fields for brands like we have for products?
2) Is there a way to integrate joomla users into product creation, like a custom field with a dropdown that accesses joomla's user database?

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 26215
  • Thank you received: 4032
  • MODERATOR
6 years 2 months ago #303063

Hello,

1 - Brands is using the category system, so does the custom field for categories.
2 - I'm sorry but I don't understand what you're talking about. Please clarify.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 0
6 years 2 months ago #303079

Hello Jerome,

Thanks for the quick reply.

Re: #2:

I have a website using hikashop (business edition) for event registration. Most of the event details are custom fields and this works well, however there is a bit of a dilemma for the event teachers. The teachers are currently setup as joomla users with a 3rd party plugin that adds some extra fields to users (bio, photo, custom fields, etc). I would like to continue using joomla users for displaying teachers, so in the backend, I wish to allow event creators to use a dropdown to select the event teachers, which is populated from joomla users.

ie. Custom field "teacher" that has a multiple select dropdown. That dropdown has 1 default value ("no teacher"). When a product is being created in the backend, I wish to access joomla users, select all the teacher users and populate the dropdown custom field with their names.

I looked in the hikashop code for products form to see how you add custom fields to the product new/edit display. I could add code here to check for the custom field "teacher" and populate it with joomla users, but I was wondering if there is a better way to do this?

Please Log in or Create an account to join the conversation.

  • Posts: 83511
  • Thank you received: 13511
  • MODERATOR
6 years 2 months ago #303100

Hi,

The best is to create your own type of custom field using the cusotm field API in a plugin of the group "hikashop":
www.hikashop.com/support/documentation/6...entation.html#fields
In your custom field code, you could extend from the single dropdown custom field type class and load dynamically the values from the database in the display function before calling the parent function.
That a lot easier and cleaner I think.
If you need an example of how to create a new custom field type, you can look at the plugins/hikashop/datepickerfield/ files. This plugin adds the "advanced date picker" type to the custom field system.

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 0
6 years 1 month ago #303498

That's a great idea, thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum