Hello, I'm trying to figure out a code to download all gallery images under each and every product with one press of a button. Thanks! Regards Rasmus
Option 1: export the product using the wp admin. This way you will get the image urls. Use any free program to download images in bulk from the url. Option 2: download images using ftp. Wp content folder
I think I have to clarify what i'm after. I want the customers to be able to download the pictures from the product page with one button that collects all of that product images. "Download all pictures".
I don't use woocommerce, but it must be storing image names in a table, along with productID. So, you need to create a new PHP page, pass the productID in URL. Now run a query to get image filenames which have that productID. Start a zip file, add individual filenames )full path, not just filenames) from query above to this zip, then either link to the zip, or give it as a download using headers.
I found this code for fetching images in woocommerce. I'm extremely new to php coding and are happy for all the help i can get. <?php global $product; $attachment_ids = $product->get_gallery_image_ids(); foreach( $attachment_ids as $attachment_id ){ echo $image_link = wp_get_attachment_url( $attachment_id );}?> I need to extend this PHP to get all files. Any suggestion on how that could look like?