The wc-download-handler code below would suggest that they are supposed to be redirected to a login page (“You must be logged in to download files”). Any idea why this does not get shown? (Yes, I have tested the file downloads and they are served fine as long as the customer is logged in.)
https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-download-handler.html
/** * Check if a download requires the user to login first. * * @param WC_Customer_Download $download Download instance. */ private static function check_download_login_required( $download ) { if ( $download->get_user_id() && ‘yes’ === get_option( ‘woocommerce_downloads_require_login’ ) ) { if ( ! is_user_logged_in() ) { if ( wc_get_page_id( ‘myaccount’ ) ) { wp_safe_redirect( add_query_arg( ‘wc_error’, rawurlencode( __( ‘You must be logged in to download files.’, ‘woocommerce’ ) ), wc_get_page_permalink( ‘myaccount’ ) ) ); exit; } else { self::download_error( __( ‘You must be logged in to download files.’, ‘woocommerce’ ) . ‘ <a href=”‘ . esc_url( wp_login_url( wc_get_page_permalink( ‘myaccount’ ) ) ) . ‘” class=”wc-forward”>’ . __( ‘Login’, ‘woocommerce’ ) . ‘</a>’, __( ‘Log in to Download Files’, ‘woocommerce’ ), 403 ); } } elseif ( ! current_user_can( ‘download_file’, $download ) ) { self::download_error( __( ‘This is not your download link.’, ‘woocommerce’ ), ”, 403 ); } } }
]]>Symptoms:
WooCommerce is routing end-user to a “Invalid download link. Go to shop” page and is providing following warnings for the articles. [See Screenshot]
Actions:
Note:
I was able to generate a working link, when digital item was uploaded to /wp-content/uploads/woocommerce_uploads/, but that is not what I want.
Screenshot
]]>Issue at hand: my website is using permalink structure %/postname% , this means all my links will end without a trailing slash, Naturally.
When i installed Trandlatepress, which i eill refer to as TP, i saw a lot of redirects on my entire website. All the UTLs generated were given a trailing slash. All hreflang’s in <head> were forced to use a trailing slash.
This is horrendously bad when reffering to SEO. It is unacceptable.
Devs answers is that they have not seen this before, it had not been an issue. I honestly don’t think they are correct in that and i REALLY want to get the matter solved.
Has anyone here found a solution? I have played around in plugin editor’s urlconverter.php or whatever it’s called but due to really bad commenting and documentation, i could not solve it.
FYI. I have turned off translatepress before google indexed to many of these trailing slash pages, as i really would be punished for it the day they are changed back to non-trailing slash URLs.
]]>My current situation:
If someone purchases a bundle product, let’s say
1. Ebook + Physical Book or
2. Physical Book + Ebook + Course
I have to:
1. Manually send the ebook download link to them
2. Manually send the ebook downlink link to them + Enroll the course to them manually
Currently automated:
1. If users buy ebook only, the download link is sent to them
My question:
A. Is there a way to automatically send the ebook download link to them like when they purchase the ebook only?
B. Is there a way to automatically enroll the course for users if they buy the bundle (Physical Book + Ebook + Course)
Thank you.
]]>I used to send permalinks of PDFs/Zipped files to my customers and on clicking on the permalinks the files start downloading directly, then after a WordPress update the links now open a webpage first, many of my customers get confused how could I make the links start downloading directly as it was before that?
ex:
https://www.advancewatertreatment.com/series-2000wp-3000wp-8000wp-gas-feeders/
I’ve a WP-WooCommerce site which is a sub-domain of another site. The file structure is:
mainsite.com
>public_html_folder
>>subsite.com
>>>wp-content_folder
I’m planning on making digital music files available. These I understand have to live in a folder OUTSIDE of the public_html folder.
I have tried making a folder for downloads called e.g. <music_files_folder>, and placing it thus:
mainsite.com
>music_files_folder
>>music_file.mp3
>public_html_folder
>>subsite.com
>>>wp-content_folder
The thing is, when I copy the URL of the music file using an FTP client, and paste it into:
WooCommerce>Products>Product data>Variations>Downloadable files>File URL
…I get a message saying either that the file does not exist, or a 404 page displays.
I’m not sure if I should be using the mainsite.com part of the URL or not, or whether I should be using:
./
…to move up one folder. Maybe WooCommerce can’t go where customers can’t go.
Can anybody tell me kind of URL I should be using here, or perhaps WooCommerce can’t cope with folders above public_html ?
Thank you.
]]>Thank you for an amazing plugin, it truly is amazing!
I’ve an issue with a automatically created download link working fine in UK mode but when switched to the German translation the download link is modified meaning that German clients get a broken link. Sample code:
UK: <a href="https://www.avalonrituals.com?do_download=file&filename=04-the-thing.mp3">sample.mp3</a>
GERMAN: <a href="https://www.avalonrituals.com/de/">sample.mp3</a>
Is there a way to get the plugin to skip translating these download link anchors?
Any help greatly appreciated.
Best regards,
-Michael
I can see the orders and set them to confirmed assuming this would trigger emails but nothing happens.
Also when using the download option and checking the download link in the order – all I get is new page in browser with message – “error”
]]>This is the first time I am using Pods in one of my websites.
I created a custom post type and a custom field to upload different PDF files for each post. So far everything is perfect. However after spending many hours in vain looking for a way to display download links in the single page I decided to post my problem here hoping that someone could help me out.
By the way I created a Pods template named ‘job_post_attachments’ with the following:
<?php
$files = $obj->field('post_attachments');
foreach ( $files as $file ) {
$url = wp_get_attachment_url( $file['ID'] );
$filename = basename ( wp_get_attachment_url( $file['ID'] ));
echo '<a href="'.esc_url($url).'">'.$filename.'</a><br>';
}
?>
And in the single page I call that template via this shortcode:
[pods name="job" template="job_post_attachments"]
The results are shown but the problem it displays all the attachments including the ones attached to other posts instead of showing only the ones specific to the currently viewed post.
How would I limit it to show only attachments of current posts
Thanks in advance
]]>