Dropdown and disabling categories in Hikamarket - adding product page

  • Posts: 224
  • Thank you received: 26
  • Hikashop Business
6 years 2 months ago #287552

-- HikaShop version -- : 3.3.0
-- HikaMarket version -- : 2.0.1
-- Joomla version -- : 3.8.5

1) I have hikamarket, and i want in the frontend, when a user is adding a new product, to have the categories in adropdown.
I know that the way is working now is good if i want to add the same product to more then one category, but i want to simplify this instead of click the little +

2) If the first option is possible, i want some categories to be blocked, so the user could not select this the blocked categories, like this in this example (Characters is blocked, sothe user have available options: Cars, Human, Animal, Plants).
-Cars
-Characters ( i want this to be desabled)
- - Human
- - Animals
-Plants

OR (3),even if i don't make the categories to be shown in a dropdown, i want to have the option 2 , to disable some categories, can i do this?

Attachments:
Last edit: 6 years 2 months ago by oxido.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 2 months ago #287603

Hello,

A similar question has been asked :
www.hikashop.com/forum/20-market-feature...ot-in-dashboard.html

In HikaMarket you have setting to change the "category" root and also setting to add "extra categories".
These settings are made in order to provide a small "category tree" and the extra allow to add other "branches" if needed.
But there is no setting to exclude the selection of categories ; unfortunately the configuration of that would be very complex and time consuming for users.

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: 224
  • Thank you received: 26
  • Hikashop Business
6 years 2 months ago #287608

Thank you, and sorry, i searched before posting, but that post I did not see.

I have 1 more question. I have create a custom field, upload file, and i want to allow only mp3 files to be uploaded, ca i do this?
I know that i have a Regular expression check field for custom text field, but not for file type.
So , can this be done?

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 2 months ago #287631

Hello,

Don't worry, I gave you the link so the other thread can be find more easily if other people do the same of search.

The "upload" custom field (classical or ajax one) are using the HikaShop settings for the file extension : "allowed files"

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: 224
  • Thank you received: 26
  • Hikashop Business
6 years 2 months ago #287662

Ok, this it is good to know, but for HikaShop settings for file extension i need to have more then 1 type, not only mp3.
The users can upload graphic content or audio.
For audio content I have created a plugin audio player, who use that field as source. And for the moment, my player can play only mp3. I will try to use jquery to check the file extension when the player select the file, and if is not mp3, to clear the field and append an error message to that field.

Last edit: 6 years 2 months ago by oxido.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 2 months ago #287683

Hello,

Since the custom fields are HikaShop custom fields, HikaMarket do not have special control on them.
I see different kind of solution :
1 - Create a "plugin custom field", like you have for the "advanced date picker" for example.
Via some improvement we made in HikaShop 3.1 ; it is now easier to extend an existing custom field. So you can create a new field which would extend from the "ajax file" so you would be able to add new setting, like one to specify the file extension (that you will verify in the "check" function of the custom field).

2 - Create a custom plugin to use the "onBeforeProductSave" trigger and, depending the context (the product form is being processed), the plugin will check the field value and refuse the operation if there is something wrong.

3 - Modifying the HikaShop core to extend the capabilities ; but best is that the modification be integrated in the core afterwards otherwise you won't be able to update your HikaShop.

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: 224
  • Thank you received: 26
  • Hikashop Business
6 years 1 month ago #288970

Hi,
I'm not able to create the plugin that extend hikashopFieldAjaxfile class. :(
Can some body help me with this task? To create a plugin that extend hikashopFieldAjaxfile class and where i will add my restriction for files that are allowed to be uploaded?
I copied all the file froms this plugin from plugin -> hikashop - > datepickerfield to create my plugin.

I've found this:

class hikashopFieldAjaximage extends hikashopFieldAjaxfile {
	var $layoutName = 'upload';
	var $mode = 'image';
	var $viewName = 'image_entry';
	var $defaultText = 'HIKA_DEFAULT_IMAGE_EMPTY_UPLOAD';
}
And tryed to use in my plugin, changing var $mode = 'file'; and var $viewName = 'file_entry';, but nothing is working after that...

Last edit: 6 years 1 month ago by oxido.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288984

Hello,

Please open a new thread in the HikaShop section of the forum since your question is not related to HikaMarket.

For the note ; the code you pasted is currently the Ajax Image class definition.
Without details about the code you're using, it would be impossible to tell you what is the problem.

Regards,

PS : Please understand that editing your own message will automatically increase the time of our answer.


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.

Moderators: Obsidev
Time to create page: 0.067 seconds
Powered by Kunena Forum