Hi there,
I’m sorry, Proteo theme don’t have this feature. But is quite simple to achieve with a bit of custom code, that I’m going to provide you ??
PHP code for your child theme functions.php file:
add_filter( 'body_class', 'yith_proteo_customization_custom_outofstock_body_class' );
/**
* Add body class if the product is only 1 on stock
*
* @param array $classes the body class array.
* @return array
*/
function yith_proteo_customization_custom_outofstock_body_class( $classes ) {
global $post;
if ( 'product' !== $post->post_type ) {
return $classes;
}
$product = wc_get_product( $post->ID );
if ( $product->get_stock_quantity() <= 1 ) {
$classes[] = 'low-stock-product';
}
return $classes;
}
You can change the minimum stock level to whatever you need (I’m using 1 now)
CSS code for your Additional CSS:
body.low-stock-product .stock {
background: red;
display: inline-block;
padding: 5px 10px;
color: #ffffff;
}
This will add a red background to the stock quantity level.
I hope you will appreciate this ??