add_action('woocommerce_before_shop_loop_item_title', 'custom_product_css');
function custom_product_css() {
global $product;
?>
<style type="text/css">
.woocommerce .products .grid-common-col.post-<?php echo $product->id; ?> {
background-image: url(<?php the_field('my_image', $product->id); ?>);
}
</style>
<?php
}