Dev Request: Event after Creating downloads
Posted: 27 Apr 2024, 15:05
Jan
I have searched and it's been requested several times; to be able to join downloads into one. I think you always confirmed it doesn't exist.
So I would like to request to create a new event to be called after you complete the creation in the _phocacart_order_downloads table when the order is completed so I can check if the order with the specified ID has multiple downloads and then combine them into one ZIP file to propose to the customer.
E.g. in our Photo shop, people might order 10-20 images or even more and it's a drag to need to download these one by one.
Also if the customer orders from multiple galleries, then the downloads list can get quite long and I don't see any form of pagination.
If in y callout code, I check if more than 1 item exists in _phocacart_order_downloads for that order, I can read all the download files, combine them into a zip and create my own entry in there pointing to the ZIP file I created with a newly created download token instead.
After testing, I would then also remove the single download rows to keep things tidy and keep the list of downloads small and to honour the configured maximum number of downloads.
I do hope that is not too much effort for you. I'd be ever so grateful.
I'm willing to offer the code for you or anyone asking.
I have searched and it's been requested several times; to be able to join downloads into one. I think you always confirmed it doesn't exist.
So I would like to request to create a new event to be called after you complete the creation in the _phocacart_order_downloads table when the order is completed so I can check if the order with the specified ID has multiple downloads and then combine them into one ZIP file to propose to the customer.
E.g. in our Photo shop, people might order 10-20 images or even more and it's a drag to need to download these one by one.
Also if the customer orders from multiple galleries, then the downloads list can get quite long and I don't see any form of pagination.
If in y callout code, I check if more than 1 item exists in _phocacart_order_downloads for that order, I can read all the download files, combine them into a zip and create my own entry in there pointing to the ZIP file I created with a newly created download token instead.
After testing, I would then also remove the single download rows to keep things tidy and keep the list of downloads small and to honour the configured maximum number of downloads.
I do hope that is not too much effort for you. I'd be ever so grateful.
I'm willing to offer the code for you or anyone asking.