From 91a184dc77720506eb7d5ff1478147e3b71d33d3 Mon Sep 17 00:00:00 2001 From: raicem Date: Fri, 9 Apr 2021 09:39:49 +0300 Subject: [PATCH] Make the call to "wc_downloadable_file_permission" with the right product id With the PR #23188, "$product_id" variable become undefined. --- includes/class-wc-ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 10e27e7e2f4..b35d97d6590 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -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 ++;