Merge pull request #29631 from raicem/fix/download-permissions

Call "wc_downloadable_file_permission" with the right product id
This commit is contained in:
Néstor Soriano 2021-04-09 17:26:55 +02:00 committed by GitHub
commit 9e8db78ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -810,7 +810,7 @@ class WC_AJAX {
if ( ! empty( $files ) ) {
foreach ( $files as $download_id => $file ) {
$inserted_id = wc_downloadable_file_permission( $download_id, $product_id, $order, $item->get_quantity(), $item );
$inserted_id = wc_downloadable_file_permission( $download_id, $product->get_id(), $order, $item->get_quantity(), $item );
if ( $inserted_id ) {
$download = new WC_Customer_Download( $inserted_id );
$loop ++;