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

#   Limit number of files for each product in frontend.

##

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

8 years 5 months ago -  8 years 5 months ago [\#293635](#293635) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Limit number of files for each product in frontend.](/forum/23-market-how-to/894915-limit-number-of-files-for-each-product-in-frontend#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 &quot;views/productmarket/form&#95;file.php&quot; 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")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

-- 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

- [ ![override-file.png](/forum/attachment/43861) ](/forum/attachment/43861 "override-file.png") [ ](/forum/attachment/43861?download=1 "override-file.png")

Last edit: 8 years 5 months ago by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk0OTE1LWxpbWl0LW51bWJlci1vZi1maWxlcy1mb3ItZWFjaC1wcm9kdWN0LWluLWZyb250ZW5kP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

8 years 5 months ago -  8 years 5 months ago [\#293642](#293642) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Limit number of files for each product in frontend.](/forum/23-market-how-to/894915-limit-number-of-files-for-each-product-in-frontend#293642 "-- 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 &quot;views/productmarket/form&#95;file.php&quot; 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")*

Hello,

In HikaMarket "Access &gt; 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 Code:

onHikaBeforeFileSave(&amp;$file, &amp;$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 Code:

displayFileMultiple

By Code:

displayFileSingle

Regards,

---

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

Last edit: 8 years 5 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: typo

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

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

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

8 years 5 months ago -  8 years 5 months ago [\#293699](#293699) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Limit number of files for each product in frontend.](/forum/23-market-how-to/894915-limit-number-of-files-for-each-product-in-frontend#293699 "-- 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 &quot;views/productmarket/form&#95;file.php&quot; 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")*

Hi again,

Thanks a lot, now it works like we want.

--
Victor

Last edit: 8 years 5 months ago by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile").

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

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

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.050 seconds

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