N
N
Nikita2017-01-26 12:14:58
WordPress
Nikita, 2017-01-26 12:14:58

How to get an array of all products in woocommerce?

You need to get an array of all products, and then use the properties of the fields of a specific product in the shortcode. How to get an array of all products

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr Crabbz, 2017-01-26
@JohnEkler

<?php
// WP_Query arguments
$args = array(
  'post_type'              => array( 'product' ),
  'post_status'            => array( 'publish' ),
  'nopaging'               => true,
);

// The Query
$query = new WP_Query( $args );

print_r($query);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question