[2.3] [API] Fixed save downloadable files for product variations, closes #8037
This commit is contained in:
parent
bcfdbcdd0a
commit
98b1845b68
|
@ -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
|
// 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 );
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue