Hi Adri,
I tried some searching myself and found some articles you might find interesting: http://googledevelopers.blogspot.com/2013/05/an-easier-way-to-save-files-to-google.html
and http://www.vibralogix.com/kb/article/saving-files-directly-to-dropbox-from-linklok-url-95.html
Then I started looking into how you would integrate these buttons into your site and I came across this article from the Woo folks: http://docs.woothemes.com/document/digitaldownloadable-product-handling/
The article raises the issue of link security. If your site has a download-to-Drive or download-to-Dropbox link, what’s to stop somebody from sharing the link with someone who has not paid? Then again, what’s to stop someone from sharing the file they download?
Security aside, you may be able to insert the button codes that into the appropriate WooCommerce template files using template overrides. I think wp-content/plugins/woocommerce/templates/email/customer-processing-order.php is the template for the email the customer gets after payment is complete. The order confirmation page template is at wp-content/plugins/woocommerce/templates/order/order-details.php. You could put your button in both those templates.
I haven’t thought this through thoroughly. Just brainstorming here…
By the way, there are a couple WordPress plugins that assist with save-to-Drive buttons.
Hey ericbakuladavis,
Thank you for your reply. Most helpful. Although it would be rather difficult for me to implement this (I’m not a coder). It points me in the right direction. I’m definitely gonna try to implement it.
thanks for now.
Hey Adri,
I have some more ideas for you
First, read up on overriding template files, if you haven’t already. It’s quite simple.
Second, in my last post, I left off the ‘s’ in ’emails’ in wp-content/plugins/woocommerce/templates/emails/customer-processing-order.php
That file does generate the email the customer gets after payment, but I think it uses a different template to fill in the items the customer has ordered (including any download links): plugins/woocommerce/templates/emails/email-order-items.php
I think line 59 is responsible for outputting download links for each downloadable product. You may be able to insert the button code right under that line. I’d first try inserting
echo '<div>some text</div';
on a new line right under 59.
Then upload it to your-theme/woocommerce/emails/email-order-items.php
Place a test order and see if ‘some text’ appears below the downloads links in the confirmation email. If so, you’re on the right track.
For the confirmation page I think the download links are put out by plugins/woocommerce/templates/order/order-details.php line 60. Try the same technique as before, then insert your button code if it all works.
Both templates use a foreach loop to ouput the download links. When there are multiple downloadable items in the order, the loop repeats until all downloadable items have been displayed. For this reason you might want to move the <script> ... </script>
part of each button outside of the foreach loop. I think the scripts only have to be called once in order to work which seems preferable to being called in each iteration of the loop.
Like I said: I’m gonna look into it. This makes it definitely a whole lot easier…. again.
It is great to point it out so detailed. Thanks again