title: Switch product image on hover on WooCommerce archive page
body: <p>Is there a way (maybe via functions.php) to change the product-image in woocommerce shops (archive page) on hover with the first attached gallery image of the product? I cannot find how to target both. I guess it must be sth like this:</p>
  
  <pre><code>add_action( 'woocommerce_shop_loop_item', 'change_image_on_hover', 10 );
  function change_image_on_hover() {
       $product-&gt;get_gallery_image_ids();
       print 'woocommerce_gallery_image';
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/zqrYW.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/zqrYW.gif" alt="enter image description here"></a></p>