Created
February 5, 2021 18:54
-
-
Save djrmom/c467b5ce8eae28e98115d6bcf9e7d377 to your computer and use it in GitHub Desktop.
facetwp woocommerce product visibility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example for product visibility for woocommerce query | |
// hides out of stock | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'product_visibility', | |
'field' => 'name', | |
'terms' => 'outofstock', | |
'operator' => 'NOT IN', | |
), | |
), | |
// other terms: 'exclude-from-search', 'exclude-from-catalog', 'featured', 'outofstock' | |
// ref: https://wordpress.stackexchange.com/questions/231118/wp-query-exclude-hidden-products-from-woocommerce-product-list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment