I have code like this for fetching and displaying products in woocommerce:
{
$args = array(
\'post_type\' => \'product\',
\'posts_per_page\' => 30
);
$loo
'product',
'posts_per_page' => 4,
'paged' => $paged
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
woocommerce_get_template_part( 'content', 'product' );
endwhile;
} else {
echo __( 'No products found' );
}
?>
Reference : Pagination in WooCommerce