How to get the WC_Product Object when using a WP_Query in WooCommerce

The global $product; doesn’t work in a custom WP_Query, instead use wc_get_product() like:

if ($slider_products_q->have_posts()):
   while($slider_products_q->have_posts()):
       $slider_products_q->the_post();         
       $product_id = get_the_ID();
       $product = wc_get_product($product_id);

       $price_html = $product->get_price_html()
       // ...

Now you can use any WC_Product methods on $product variable.

Alternatively, you could use a WC_Product_query.