Use $_product object instead of undefined $product_id for downloadable permissions. Fixes #4095

This commit is contained in:
Scott Basgaard 2013-11-12 23:37:39 -05:00
parent f7c3362e8a
commit 8a45886a4c
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ function woocommerce_downloadable_product_permissions( $order_id ) {
$_product = $order->get_product_from_item( $item );
if ( $_product && $_product->exists() && $_product->is_downloadable() ) {
$downloads = get_post_meta( $product_id, '_downloadable_files' ) ;
$downloads = get_post_meta( $_product->id, '_downloadable_files' ) ;
foreach ( $downloads[0] as $download_id => $download )
woocommerce_downloadable_file_permission( $download_id, $item['variation_id'] > 0 ? $item['variation_id'] : $item['product_id'], $order );