Quantcast
Channel: Phoca Forum
Viewing all articles
Browse latest Browse all 1996

Phoca Cart • Re: Download personalized digital document

$
0
0
I solved it using a system plugin. In the onAfterInitialise method, I intercept the PhocaCart download.download task and created a local modification of the original download script.
Here's how it works:

- I retrieve the file path stored in the library's $absOrRelFile variable and pass it to a custom plugin method.
- In this method, I read the file, modify it dynamically, and save it as a temporary file.
- I then return the temporary file's path for download, and once the download is complete, the file is deleted.

This approach eliminates the need to store multiple versions of the file. By using the order_token and download_token, I can accurately determine how to personalize the document at the time of download.

Statistics: Posted by keep2000 — 08 Mar 2025, 08:07



Viewing all articles
Browse latest Browse all 1996

Trending Articles