Limit number of files for each product in frontend.

  • Posts: 634
  • Thank you received: 16
5 years 10 months ago #293635

-- HikaShop version -- : 3.4.0
-- HikaMarket version -- : 2.1.1
-- Joomla version -- : 3.8.8

Hi,

I want to limit to a single file the number of files that a vendor can upload for a product in the hikamarket frontend editor.

The same way it happens when a custom field is of image type.

How can I change the view code for product form "views/productmarket/form_file.php" so it accepts only one file?

Is a parameter available to limit this in a certain view (I don't want this change to affect the whole site)?

Thanks,

PD: Please, ignore the attached file.

--
Victor

Attachments:
Last edit: 5 years 10 months ago by PeterChain.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
5 years 10 months ago #293642

Hello,

In HikaMarket "Access > Vendor options" you have some available limitations like the maximum number of prices, categories, options, related, images... But there is setting for the files !
So it will be something I will add in a future release (it should be the next one).

But please note that the limitation do not remove the previous data ; it just refuse the addition of extra elements.
If you do want to delete the old one and put a new one ; best would be to use a trigger like

onHikaBeforeFileSave(&$file, &$do)
But that trigger is currently not called with drag'n'drop upload, just with the popup.
It could be something that we could improve (but we will need more feedback on it)

Now if you just want to have an uploader with one single entry ; you can override the view and replace the call of
displayFileMultiple
By
displayFileSingle

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.
Last edit: 5 years 10 months ago by Jerome. Reason: typo
The following user(s) said Thank You: PeterChain

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

  • Posts: 634
  • Thank you received: 16
5 years 10 months ago #293699

Hi again,

Thanks a lot, now it works like we want.

--
Victor

Last edit: 5 years 10 months ago by PeterChain.
The following user(s) said Thank You: Jerome

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

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