• marky10000

    (@marky10000)


    I’m selling digital products and in my testing, I have discovered that the download link which is provided in the email confirmation to customers doesn’t work. Clicking on it results in a WordPress error which states:

    WordPress error “This is not your download link.”

    It’s a large file 230mb, and I have set woocommerce/settings/products to redirect only for the moment although godaddy assure me that they now accept x-sendfile.

    I have tried setting the URL and the absolute path as suggested by woocommerce here: https://docs.woothemes.com/document/digitaldownloadable-product-handling/ but that just results in a path error.

    Have any of you seen this before? I’ve searched and searched but haven’t come across anything useful.

Viewing 1 replies (of 1 total)
  • kobashicomputing

    (@kobashicomputing)

    After looking at the code for WooCommerce eCommerce plugin, this message is coming from the plugin itself, not from WordPress.

    woocommerce\includes\class-wc-download-handler.php
    —————————————————

    if ( $user_id && get_option( 'woocommerce_downloads_require_login' ) == 'yes' ) {
       if ( ! is_user_logged_in() ) {
          wp_die( __( 'You must be logged in to download files.', 'woocommerce' ) <snip>
       } elseif ( ! current_user_can( 'download_file', $download_result ) ) {
          wp_die( __( 'This is not your download link.', 'woocommerce' ), '', array( 'response' => 403 ) );
       }
    }

    The user is logged in but doesn’t have permission to download the file. This is due to the wrong role or capability.

    Looking at WooCommerce Product Settings, there is an access restriction section for Downloadable Products. One of the settings is “Downloads require login” and it is unchecked by default.

    There is also the “Grant access to downloadable products after payment” setting that is checked by default.

    Test with all combinations between the two checkboxes being logged in and as a guest.

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot download links when testing on site’ is closed to new replies.