Plugin Directory

Opened 5 years ago

#2957 new enhancement

Only show in stock Products in "WooCommerce Display Products by Tags" plugin

Reported by: aghorbanmehr's profile aghorbanmehr's profile aghorbanmehr 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?

)

)

);

Change History (0)

Note: See TracTickets for help on using tickets.