Hi Philippe( @camouyer ),
Add the below code snippet in the active theme functions.php file to display only the INSTOCK products.
add_filter('woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_instock_best_selling', 10, 3);function woocommerce_shortcode_products_instock_best_selling($query_args, $attributes, $type) {
if ('best_selling_products' === $type) {
$query_args['meta_query'][] = array(
'key' => '_stock_status',
'value' => 'instock',
);
}
return $query_args;
}
Thank you so much ! it works perfectly !