Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
I am attempting to setup CART to provide digital downloads of a PDF that I have created, and am at a complete loss as to the setup. Again, this is not a photo. I would like to know where to store the file on the server and what I need to setup in cart to get this to work. Everything that I have done so far has been for naught.
Thanks for any help.
Offline
I don't believe you'll be able to set this up for an instant download, like you can for a picture in a gallery.
But you could create a product page and use a write-in button to sell the pdf. Once you've received payment confirmation you'd need to fulfill the order manually, or perhaps set up a password protected page that contains the link to the file.
You can then store the file anywhere on the server.
Maybe others will have better ideas...
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
You can provide non-images as digital purchases, but they must mirror the name of a photo within a gallery. For example, a gallery could have an images named the-document.jpg, with pricing set up to allow digital purchases. You'd then need to upload a file title the-document.pdf into the photos-for-purchase subdirectory of the gallery, and make sure to remove any corresponding the-document.jpg in photos-for-purchase.
Offline
oooh. That's intriguing. Could this be done in a Theater single image page using write-in buttons?
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
To be honest, I have no idea. The digital downloads mechanism for galleries is designed to pick up the first file that matches the filename without extension.
Offline
Hi Ben,
I can report that this sort of works with a write-in button.
I created an album using a theater template set to single image
the name of the image file is the same name as the pdf file. The pdf file is placed in a photos-for-purchase folder I created in the album.
I can complete the purchase and get the download link. The only issue is that the link goes to name-of-file.jpg.
The file downloads as name-of-file.jpg however it cannot be opened as such. If I change the extension on the file to .pdf, I can open the pdf.
I know this is probably way beyond the intention of the write in buttons, but it sure would be handy if the pdf could be downloaded with the proper extension.
Is there another attribute that can be added to the write-in button that would specify the extension of the data-item file?
(I tried adding the extension to the data-item)
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
This is all very interesting information, and while somewhat helpful, I too would like to find out if there is an attribute that can be used to specify the extension.
Offline
There is not an attribute for this. I'll look into this to see whether the wrong extension is a bug.
Offline
I've had a play around with the code. Support for digital purchases of files other than JPEG renditions from Lightroom is a little weak for write-in buttons.
Firstly, there is a bug in resolving the found file name, as you had found. This was the result of an earlier bug fix. I'll have a fix for this in a future cart update, possibly a silent update if this is the only fix being added. In the mean time, this can be resolved by editing the file module-cart/application/helpers/ApplicationHelper.php and changing the lines from line 692 from this:
//$file_name = basename($from); // This is empty when the digital purchase is not found
$file_name = basename($item->photo_path);
To this:
$file_name = basename($from); // This is empty when the digital purchase is not found
if (!$file_name) {
$file_name = basename($item->photo_path);
}
Secondly, the downloaded filename must match the name of the data-thumbnail attribute. For example, a thumbnail of the-document.jpg would correspond to the-document.pdf.
Thirdly, the data-item doesn't affect the name of the file that is looked for or downloaded. It probably should, and take precedence over (and make unnecessary) the data-thumbnail attribute.
Fourthly, should you use the option to enable offline digital purchases for non-jpg files, the naming problem will persist.
Offline
Brilliant! works perfectly. The only problem is that now I need to write an ebook
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Wonderful information, Ben, and Rod, a big thanks for the testing. I can't wait to implement this.
Offline
Pages: 1