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

#   multi-vendor plugin - process uploaded files

##

- **[DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")**
- [![DeeEmm's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar26410.jpg)](/forum/user/26410-deeemm "View DeeEmm's Profile") Topic Author
- [ Offline](/forum/user/26410-deeemm)

Less More

- Posts: 114
- Thank you received: 14
-
- [](http://deeemm.com)
-

13 years 1 month ago [\#124190](#124190) by [DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")  *[multi-vendor plugin - process uploaded files](/forum/31-development/862144-multi-vendor-plugin-process-uploaded-files#124190 "Hi  My site uses hikamarket multi-vendor to allow users to sell downloadable files.  I want to create a plugin to perform some actions on the files uploaded by my users.  I will then use this information to populate some custom fields that are viewable on the product page.  I have looked in the documentation but cannot see any events related to file handling so am not sure of how to proceed other than to make some core hacks.  Any advice, ideas or pointers greatly appreciated.  TIA  /DM")* was created by *[DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")*

Hi

My site uses hikamarket multi-vendor to allow users to sell downloadable files.

I want to create a plugin to perform some actions on the files uploaded by my users.

I will then use this information to populate some custom fields that are viewable on the product page.

I have looked in the documentation but cannot see any events related to file handling so am not sure of how to proceed other than to make some core hacks.

Any advice, ideas or pointers greatly appreciated.

TIA

/DM

---

[ deeemm.com](http://deeemm.com)

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

13 years 1 month ago [\#124195](#124195) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[multi-vendor plugin - process uploaded files](/forum/31-development/862144-multi-vendor-plugin-process-uploaded-files#124195 "Hi  My site uses hikamarket multi-vendor to allow users to sell downloadable files.  I want to create a plugin to perform some actions on the files uploaded by my users.  I will then use this information to populate some custom fields that are viewable on the product page.  I have looked in the documentation but cannot see any events related to file handling so am not sure of how to proceed other than to make some core hacks.  Any advice, ideas or pointers greatly appreciated.  TIA  /DM")*

Hi,

Why not use the onAfterProductCreate and onAfterProductUpdate triggers of HikaShop for that ?
Even when the products are created/edited via HikaMarket on the frontend, these triggers should allow you to plug yourself after the product edition/creation and allow you to access the files uploaded by the users.

The following user(s) said Thank You: [DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")

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

- **[DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")**
- [![DeeEmm's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar26410.jpg)](/forum/user/26410-deeemm "View DeeEmm's Profile") Topic Author
- [ Offline](/forum/user/26410-deeemm)

Less More

- Posts: 114
- Thank you received: 14
-
- [](http://deeemm.com)
-

13 years 1 month ago [\#124227](#124227) by [DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")  Replied by *[DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")* on topic *[multi-vendor plugin - process uploaded files](/forum/31-development/862144-multi-vendor-plugin-process-uploaded-files#124227 "Hi  My site uses hikamarket multi-vendor to allow users to sell downloadable files.  I want to create a plugin to perform some actions on the files uploaded by my users.  I will then use this information to populate some custom fields that are viewable on the product page.  I have looked in the documentation but cannot see any events related to file handling so am not sure of how to proceed other than to make some core hacks.  Any advice, ideas or pointers greatly appreciated.  TIA  /DM")*

Hi Nicolas.

Thanks for the prompt reply.

Was getting late last night and I seemed to have missed the obvious. Guess I was not thinking straight o_O

Can I access any of the file data information directly from within the onAfterProductCreate method? eg as an attribute of $element or will I need to extract this information manually by cross referencing #__hikashop_product.product_id and #__hikashop_file.file_ref_id

TIA

/DM

---

[ deeemm.com](http://deeemm.com)

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

13 years 1 month ago [\#124290](#124290) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[multi-vendor plugin - process uploaded files](/forum/31-development/862144-multi-vendor-plugin-process-uploaded-files#124290 "Hi  My site uses hikamarket multi-vendor to allow users to sell downloadable files.  I want to create a plugin to perform some actions on the files uploaded by my users.  I will then use this information to populate some custom fields that are viewable on the product page.  I have looked in the documentation but cannot see any events related to file handling so am not sure of how to proceed other than to make some core hacks.  Any advice, ideas or pointers greatly appreciated.  TIA  /DM")*

Hi,

I checked the code and I see that there is no specific triggers for the "file save" in HikaShop and HikaMarket does not add triggers for the "file upload" in the front-end.
For the trigger "onAfterProductCreate" and "onAfterProductUpdate", you can have the files in some conditions but the files are stored in another table. So I think that the best will be an addition of triggers.

In the table "hikashop_file", you can find the product files using the "file_type" column ("product" value) and the "file_ref_id" (which will contains the "product id").

Regards,

---

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

The following user(s) said Thank You: [DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")

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

- **[DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")**
- [![DeeEmm's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar26410.jpg)](/forum/user/26410-deeemm "View DeeEmm's Profile") Topic Author
- [ Offline](/forum/user/26410-deeemm)

Less More

- Posts: 114
- Thank you received: 14
-
- [](http://deeemm.com)
-

13 years 1 month ago [\#124292](#124292) by [DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")  Replied by *[DeeEmm](/forum/user/26410-deeemm "View DeeEmm's Profile")* on topic *[multi-vendor plugin - process uploaded files](/forum/31-development/862144-multi-vendor-plugin-process-uploaded-files#124292 "Hi  My site uses hikamarket multi-vendor to allow users to sell downloadable files.  I want to create a plugin to perform some actions on the files uploaded by my users.  I will then use this information to populate some custom fields that are viewable on the product page.  I have looked in the documentation but cannot see any events related to file handling so am not sure of how to proceed other than to make some core hacks.  Any advice, ideas or pointers greatly appreciated.  TIA  /DM")*

Hi Jerome,

Thanks for looking into that for me.

onAfterProductCreate / onAfterProductUpdate should be adequate for my needs, I can fetch the filename from the #__hikashop_file table.

Thinking about this it might actually be better to carry out the file actions that I need to do after the upload / update so that there is no delay to the user in the front end.

I have a couple of other questions related to the plugin but I will start a new thread for these as they are a bit off topic.

Thanks for your help

---

[ deeemm.com](http://deeemm.com)

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

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

Time to create page: 0.052 seconds

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