Jump to content

Hook On Download File - Virtual Product


Recommended Posts

I want to listen when the customer download the file(For virtual products obviusly) and then block download and force another download. It is can feel strange, but is not too much. I'm import ebooks from webservice and then add in database prestashop. When the customer click on donwload i'll check if the ebook is "my" and if true i will call endpoint in webservice that will download the "my ebook". 

 

So...

 

At this time my only idea is override the GetFileControllerCore and make the modification, but as you know, override core functionality is not a good idea.

 

I'm totally beginner in prestashop and if anybody can suggest me or has a better ideal. tell me please.

 

Thanks!1

Link to comment
Share on other sites

I know there are no hook for download(I see in the list), but what i want is one idea for simulate that. 

I find the hook displayOrderDetail that is called before the customer see order detail(with product link for download etc etc) and i'm think to do something is this place, but i do know what to do exactly.

 

Maybe open the .tpl file that is called with order detail information and make changes in product link to make his going to my file and do my download, but i do know it is a good idea, because one shop work different from another and  i'm not able to predict all situations.

 

I think there is no other way than that override the getFileController.

 

:unsure:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...