Opened 5 years ago
#2957 new enhancement
Only show in stock Products in "WooCommerce Display Products by Tags" plugin
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | high | Severity: | normal |
| Plugin: | not-listed | Keywords: | In stock |
| Cc: |
Description
Only show in stock Products
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'orderby' => $ordering_argsorderby?,
'order' => $ordering_argsorder?,
'posts_per_page' => $attsper_page?,
'meta_query' => $meta_query,
'meta_query' => array(
array(
'key' => '_stock_status',
'value' => 'instock'
),
array(
'key' => '_backorders',
'value' => 'no'
),
),
'tax_query' => array(
array(
'taxonomy' => 'product_tag',
'terms' => array_map( 'sanitize_title', explode( ',', $attstags? ) ),
'field' => 'slug',
'operator' => $attsoperator?
)
)
);