• Resolved mattiamariejulie

    (@mattiamariejulie)


    Hello,

    I wish to remove or hide the availability on the single product page.
    What I’ve already done is disabling the ‘enable stock management’ in the Woocommerce settings, that didn’t work.
    Additional I’ve tried to use this code in the functions.php file of my theme:

    function my_wc_hide_in_stock_message( $html, $text, $product ) {
    	$availability = $product->get_availability();
    	if ( isset( $availability['class'] ) && 'in-stock' === $availability['class'] ) {
    		return '';
    	}
    	return $html;
    }
    add_filter( 'woocommerce_stock_html', 'my_wc_hide_in_stock_message', 10, 3 );

    But the code doesn’t work either. I keep seeing ‘Availability:
    In Stock & Ready to Ship’

    Is there something wrong with the code? Something else I should check?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Removing Availability’ is closed to new replies.