Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $products = new WP_Query(array('post_type' => 'product', 'posts_per_page' => -1));
- while ($products->have_posts()) : $products->the_post();
- $id = get_the_ID();
- $product = new WC_Product($id);
- //your remaining code to get all product info
- endwhile;
Add Comment
Please, Sign In to add comment