Phoca Cart Download Options

Phoca Cart - complex e-commerce extension
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 74
Joined: 14 Nov 2022, 12:04

Phoca Cart Download Options

Post by keep2000 »

Hello everyone,

I tried to understand how downloadable products work in Phoca Cart but got a bit confused.

My goal is to build an ebook shop where each product has three ebook formats (EPUB, MOBI, AZW3). After purchasing a book, the customer should be able to download the format required for their ebook reader.

I added a product and selected Digital (Downloadable) Product as the product type. Then, I went to 'Download Options', uploaded a file, and added two more additional files. This process was a bit tricky because EPUB had the correct MIME type, but MOBI and AZW3 were detected as application/octet-stream. I set 'Ignore File Types Checking' to Yes, but apparently, this does not apply to MIME types, only to the file extension filter.

So I set application/octet-stream as the MIME type, which allowed me to upload them to the server. However, I was not able to download them. After some troubleshooting, I realized that unpublished items were created in the 'Downloads' menu item, so I published them. This allowed me to download the files, except for one, which had a character difference between the actual filename and the filename stored in #__phocacart_products.download_file.

I wanted to debug this further, so I deleted all downloads from 'Downloads'. However, when I opened the product again, the downloadable entries were still there, but I was unable to download them from the frontend, even though the files were still on the server. I removed all additional downloads but couldn't remove the main download file, as there was only a 'Select file' option. After some time, I realized that even though the 'Download file' field has a chevron, similar to a <select> element, it is actually a text input, so I was able to modify or clear the input.

After that, I deleted the files via FTP and re-uploaded them using the product's 'Download Options' tab. However, my 'Downloads' list (administrator/index.php?option=com_phocacart&view=phocacartdownloads) does not show any available downloads.

Have I missed something? :)

Thank you in advance.

PC 5.0 beta 99
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48706
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Cart Download Options

Post by Jan »

Hi, are you speaking about download of file when user purchase the product (in download area) or about public downloadable files in frontend?

Jan
If you find Phoca extensions useful, please support the project
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 74
Joined: 14 Nov 2022, 12:04

Re: Phoca Cart Download Options

Post by keep2000 »

Hi,

I’m referring to the download of files when a user purchases a product. Since this is an ebook store, customers should be able to download their purchased books in their preferred format (EPUB, MOBI, or AZW3) from their account.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48706
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Cart Download Options

Post by Jan »

Hi, the best way is always use e.g. ZIP for download and if there is a ZIP you can attachment more formats to this package.

So there are two options:
- add more files to one ZIP
- or use additional file feature in product edit where you can set more files.

Jan
If you find Phoca extensions useful, please support the project
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 74
Joined: 14 Nov 2022, 12:04

Re: Phoca Cart Download Options

Post by keep2000 »

Hello.

It looks like I have mostly managed to solve this, there was some misunderstanding. I created a "Downloads" menu item for logged-in users and restricted the download option to the "Completed" order status.

When I place an order, I receive an order confirmation email, and when the order status changes to "Completed", I receive another email. In this second email, after the "Display Order" button, there is also a "Download Links" section.

I have three attached files, and in the email, all three links point to:
option=com_phocacart&view=download&Itemid=180
This works perfectly—when I log in, I can see all three files, the book title, the order ID, the status, and the download button.

I only have one question:
When I click the "Display Order" button in the email, it lists all my orders. However, when I check the details of a specific order, there is no indication that downloads are available, even though they are clearly visible in the email.
Is it possible to display the download links there as well?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48706
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Cart Download Options

Post by Jan »

Hi, what do you mean with "details of a specific order"?

jan
If you find Phoca extensions useful, please support the project
Post Reply