• Resolved Adri Oosterwijk

    (@adri-oosterwijk)


    Hi,

    I’m developing a site with downloadable products. As the theme is responsive it is possible that visitors will browse and use the site on a mobile device (at least that’s one of my goals). After a purchase it is possible for my client to download the product to their device.

    That is not (IMHO) the best practice when a mobile device is used. Does anyone knows a way that the file to be download is delivered or downloaded to a dropbox or google drive account?

    It would be great if a user can enter their credentials for the services mentioned above on the checkout page and even better on the user registration page (for a default setting).

    Does anyone knows if such a solution exists? My research results in nothing (but that can be my mistake). Or do I have to develop it myself?

    Please advice.

    https://wordpress.org/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • ericbakuladavis

    (@ericbakuladavis)

    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.

    Thread Starter Adri Oosterwijk

    (@adri-oosterwijk)

    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.

    ericbakuladavis

    (@ericbakuladavis)

    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.

    Thread Starter Adri Oosterwijk

    (@adri-oosterwijk)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Download products to dropbox, google drive etc.’ is closed to new replies.