Support » Plugin: WooCommerce » Removing Availability

  • 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)
  • Plugin Support Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    Hi @mattiamariejulie,

    That sounds like something added by a plugin or your theme. Does this show up with just WooCommerce activated and with a default theme(Storefront or 2019)?

    mattiamariejulie

    (@mattiamariejulie)

    Tested with the storefront and it seems to be a theme issue. Thank you will forward it to the theme developer.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.