I am trying to fetch all the products of the WooCommerce from the database using PHP. But it is not giving me the list of all products <select Name='choose'> <?php $args = array( 'post_type' => 'product' ,'posts_per_page' => 100); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); echo '<option selected value="'.the_title().'</option>'; endwhile; ?> </select> How can I get all the products of WooCommerce?
Originally asked by Azad Chouhan on Stack Exchange (stackoverflow) (CC BY-SA 4.0).