How to hide Out of Stock product from the Slider

Plugin Author
WPBean

(@wpbean)

Hi,

You are using our WPB Product Slider plugin on your site.

You can use this forum for this plugin support: https://projectdmc.org/support/plugin/wpb-woocommerce-product-slider/

We have an checkbox in WPB Product Slider Pro plugin’s settings for enable or disable the out of stock products for the slider.

You can add this PHP code in your theme or child theme’s functions.php for doing the same for the free version.

add_filter( 'wpb_wcs_shortcode_quary_args', function($args){
$args['tax_query'][] = array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => array('outofstock'),
'operator' => 'NOT IN'
),
); // WPCS: slow query ok.

return $args;
} );

The WPB WooCommerce Zoom is our different plugin.

Thank You

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer