How do that. File Size Output for DG Products
-
Help with that..
<?php
global $product;
$downloads = $product->get_files();
foreach( $downloads as $key => $each_download ) {
$info = pathinfo($each_download[“file”]);
$ext = $info[‘extension’];
$formats .= $ext . “, “;
}echo ‘<p> Formats: ‘. $formats .'</p>’;
?>
How do that too for the File Size? I have a Woo for Digital Products.. But anyone codes not worked for OutPut File Size.. But File format output work good.
I try this:
https://wordpress.stackexchange.com/questions/477/how-do-i-get-the-size-of-an-attachment-file/546#546Not work
The code in this thread works great! But only for the file extension, I asked if there is the same code for outputting the size of the file added to the Woo product (as a virtual, downloadable)? I try use all codes from forums where is WP filesize (file size output) but not worked nothing
- The topic ‘How do that. File Size Output for DG Products’ is closed to new replies.