multi-vendor plugin - process uploaded files
13 years 1 week ago #124190
by DeeEmm
multi-vendor plugin - process uploaded files was created by DeeEmm
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
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
Please Log in or Create an account to join the conversation.
13 years 1 week ago #124195
by nicolas
Replied by nicolas on topic multi-vendor plugin - process uploaded files
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.
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
Please Log in or Create an account to join the conversation.
13 years 1 week ago #124227
by DeeEmm
Replied by DeeEmm on topic multi-vendor plugin - process uploaded files
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
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
Please Log in or Create an account to join the conversation.
13 years 1 week ago #124290
by Jerome
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.
Replied by Jerome on topic multi-vendor plugin - process uploaded files
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,
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 & 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.
The following user(s) said Thank You: DeeEmm
Please Log in or Create an account to join the conversation.
13 years 1 week ago #124292
by DeeEmm
Replied by DeeEmm on topic multi-vendor plugin - process uploaded files
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
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
Please Log in or Create an account to join the conversation.
Time to create page: 0.148 seconds