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

#   file uploading will be Required

##

- **[m2008](/forum/user/43075-m2008 "View m2008's Profile")**
- [![m2008's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/43075-m2008 "View m2008's Profile") Topic Author
- [ Offline](/forum/user/43075-m2008)

Less More

- Posts: 1
- Thank you received: 0
-
-

10 years 1 month ago [\#249595](#249595) by [m2008](/forum/user/43075-m2008 "View m2008's Profile")  *[file uploading will be Required](/forum/23-market-how-to/886368-file-uploading-will-be-required#249595 "Hi an Thank you for your good component  I want that user upload file via product creation and it must be (Required) how can i do this?! (uploading file will be Required).")* was created by *[m2008](/forum/user/43075-m2008 "View m2008's Profile")*

Hi an Thank you for your good component

I want that user upload file via product creation and it must be (Required)
how can i do this?! (uploading file will be Required).

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

10 years 1 month ago [\#249606](#249606) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[file uploading will be Required](/forum/23-market-how-to/886368-file-uploading-will-be-required#249606 "Hi an Thank you for your good component  I want that user upload file via product creation and it must be (Required) how can i do this?! (uploading file will be Required).")*

Hi,

There is no built-in option for that kind of check ; but it is possible to add it using a small custom plugin.

Thanks to the trigger "onBeforeProductCreate" you can catch the product creation.
In that function you can check that you're in the front-end (so in HikaMarket) and get the current logged vendor.
Afterwards, you can check the product content and set the variable " $do " to False if you want to refuse the product creation.
[ www.hikashop.com/support/documentation/6...ntation.html#product](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#product)

To check that HikaMarket is initialized and get the current vendor you can use that code Code:

if(!defined('HIKAMARKET_COMPONENT')) // Do nothing if we are not in HikaMarket return; $vendor_id = hikamarket::loadVendor(false); if($vendor_id == 1) // Do not block the main vendor return ;

You can also use the trigger "onBeforeProductUpdate" if you also want to check the product files for the updates (and not just the creation) but you'll have to add more checks because a product can be update partially ; so you have to be sure that the product update is coming from the HikaMarket product edition (reading the parameters in the URL could be a good solution).

Regards,

---

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

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

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

[](#top)
