Since WooCommerce 2.2
you are able to simply use the wc_get_product
Method. As an argument you can pass the ID
or simply leave it empty if you're already in the loop.
wc_get_product()->get_id();
OR with 2 lines
$product = wc_get_product();
$id = $product->get_id();