-- HikaShop version -- : 4.7.0
-- Joomla version -- : 4.latest
-- PHP version -- : 8.1
Hello,
With your help, I managed to create a plugin that prints user information on each page of an e-book(s) via onBeforeDownloadFile.
In onBeforeDownloadFile, I take the user's email and other user info, add this information to each page of a pdf (using the Setas package), and create a new pdf file. The user can then download this new pdf file. This is called social digital rights management (social DRM). The idea is that when people see their name on each page of an E-book, they will think twice before uploading it to share with the rest of the world. From a coding point of view, it all works perfectly. Thanks for your help.
Now I want to add something extra. A university library may buy 10 of our E-books. If that happens, then I would like to implement the following.
1. A librarian purchases our package via hikashop.
2. The librarian gets an invoice, order number and an email with a download link.
3. The idea is that the librarian makes the order number available on their internal catalog, plus a link to our website. In specific to our 'Customer download space' menu item.
4. Now there are potentially hundreds of students from that library who want to download our e-books. But instead of the user info from the librarian, I want to add the email address of the student to each page of each pdf.
My question is now as follows. Once a student logs into the 'Customer download space' (using the login info from the librarian)....how can I now collect information from the student and pass that on into onBeforeDownloadFile? To be more specific, before they click on the download button, I need to grab their email address via a pop-up message and pass this into onBeforeDownloadFile so that I can grab it there, and create a new pdf again.
Where would I do this? Or is there any other way of doing this? Or should I go the Joomla usergroup route?
So..in short....the purchased product is associated to a specific client and I need to give hundreds of other people access to it. But I want to extract information from the original purchaser and from hundreds of students to an existing pdf.
Kind regards,
Alain