I want to get all the product data in the WooCommerce (product sku, name, price, stock count, availability and etc.) Can I do that using wp-query?
5 comments
Comments are closed.
I want to get all the product data in the WooCommerce (product sku, name, price, stock count, availability and etc.) Can I do that using wp-query?
Comments are closed.
This way you can get all products via wp_query :
And if you want further product data then it will be like this :
Thanks for all reply.I have resolve that like billows
When your building out your query set the post type to be product
And that will only search through woocommerce products.
Also if you are creating a theme, you can take any file from the
/wp-content/plugins/woocommerce/templates/
directory and put it inside of/wp-content/themes/<yourTheme>/woocommerce
to override any woocommerce page.you can write this code in page that you want to display all product information
This is an old question; the answers using
WP_Query()
are obsolete since 2018.See my answer here.