Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 Multiple download files in a product all link to the first download file #13923

Closed
mikkamp opened this issue Apr 5, 2017 · 0 comments
Closed
Assignees
Labels
type: bug The issue is a confirmed bug.

Comments

@mikkamp
Copy link
Contributor

mikkamp commented Apr 5, 2017

I setup a virtual / downloadable product with multiple download files. When purchasing the product, after the order is marked as complete the user gets access to all the download files contained within the product.

However when they click on each of the unique download links they all return the same file.

I had a look through the code and it seems the file includes/data-stores/class-wc-customer-download-data-store.php contains a function get_downloads which retrieves all the user downloads.

The download_id is passed to this function as one of the arguments, but it is never included in the database query. So it just returns the first download file.

It seems the following code is missing from this function:

if ( $args['download_id'] ) {
	$query[] = $wpdb->prepare( "AND download_id = %s", $args['download_id'] );
}

When I add this I get the correct download for each download link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants