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?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Thanks for all reply.I have resolve that like billows
you can write this code in page that you want to display all product information
This way you can get all products via wp_query :
And if you want further product data then it will be like this :
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.