Hide stock status after selecting variation on single product page

This topic has 4 replies, 3 voices, and was last updated 2 weeks, 3 days ago ago by Tony Rodriguez

  • Avatar: Akmal
    Akmal
    Participant
    January 10, 2026 at 07:44

    Hi, can you help me to hide stock status after selecting variation on single product page (check the screen). I try to make it without css.

    I have tried this:
    add_filter( 'woocommerce_get_availability_text', '__return_empty_string' );

    and

    add_filter( 'woocommerce_available_variation', function ( $variation_data ) {
        $variation_data['availability_html'] = '';
        return $variation_data;
    });

    It’s not work…

    Files is visible for topic creator and
    support staff only.
    3 Answers
    Avatar: Samir Malik
    Samir Malik
    Support staff
    January 10, 2026 at 12:52

    Hello,

    We have implemented the following custom code, and it is functioning correctly:

    
    // Remove stock HTML from variation data
    add_filter('woocommerce_available_variation', 'remove_variation_stock_html', 999, 3);
    function remove_variation_stock_html($data, $product, $variation) {
        // Remove the availability_html which contains stock status
        $data['availability_html'] = '';
        return $data;
    }
    

    Could you please review it once again?

    Thank you.

    Best regards,
    The 8Theme Team

    Avatar: Akmal
    Akmal
    Participant
    January 10, 2026 at 13:05

    Thanks for the support! My topic “Hide stock status after selecting variation on single product page” has been successfully resolved.

    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    January 10, 2026 at 13:05

    Dear Akmal,

    We really appreciate your time and engagement within the WordPress & WooCommerce community

    Your feedback drives every improvement we make in XStore — helping us deliver a smoother and more flexible experience with each update.

    Your input makes a real difference.

    Topic closed.
    The 8Theme Team

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘Hide stock status after selecting variation on single product page’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.