protected function read_downloads(&$product)
{
$meta_values = array_filter((array) maybe_unserialize(get_post_meta($product->get_id(), '_downloadable_files', true)));
if ($meta_values) {
$downloads = array();
foreach ($meta_values as $key => $value) {
$download = new WC_Product_Download();
$download->set_id($key);
$download->set_name($value['name'] ? $value['name'] : wc_get_filename_from_url($value['file']));
$download->set_file(apply_filters('woocommerce_file_download_path', $value['file'], $product, $key));
$downloads[] = $download;
}
$product->set_downloads($downloads);
}
}