Guest User

Untitled

a guest
Nov 21st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. $products = new WP_Query(array('post_type' => 'product', 'posts_per_page' => -1));
  2.  
  3. while ($products->have_posts()) : $products->the_post();
  4. $id = get_the_ID();
  5. $product = new WC_Product($id);
  6. //your remaining code to get all product info
  7. endwhile;
Add Comment
Please, Sign In to add comment