[2.3] [API] Fixed save downloadable files for product variations, closes #8037

This commit is contained in:
Claudio Sanches 2015-04-25 12:19:30 -03:00
parent bcfdbcdd0a
commit 98b1845b68
1 changed files with 2 additions and 1 deletions

View File

@ -1587,7 +1587,8 @@ class WC_API_Products extends WC_API_Resource {
// Grant permission to any newly added files on any existing orders for this product prior to saving
do_action( 'woocommerce_process_product_file_download_paths', $product_id, $variation_id, $files );
update_post_meta( $product_id, '_downloadable_files', $files );
$id = ( 0 === $variation_id ) ? $product_id : $variation_id;
update_post_meta( $id, '_downloadable_files', $files );
}
/**