• I am trying to customize my in stock. Currently it shows default in stock status as “2 in stock (also available on backorder)”

    Instead I want it to say “2 in stock (in stock items may take 5 to 7 business days to ship)”

    I am using the Code Snippet plug-in. Is there a way I can add code to code snippet to achieve this?

    i have found similar thread here (https://wordpress.org/support/topic/woocommerce-remove-related-products-and-change-out-of-stock-text?replies=11), but it is 3 years old and the code does not work in Code Snippet plug-in.

    EDIT EDIT EDIT:

    Per my usual MO I find the solution 5 minutes after posting. But still need help. The below code works but it removes the number of items in stock. I would still like the number of items that are in stock to display.

    Here is code that works so far, just would like it to show number of items in stock as well:

    add_filter( ‘woocommerce_get_availability’, ‘custom_get_availability’, 1, 2);

    function custom_get_availability( $availability, $_product ) {
    if ( $_product->is_in_stock() ) $availability[‘availability’] = __(‘In Stock items may take 5 to 7 business days to ship’, ‘woocommerce’);

    return $availability;
    }

  • The topic ‘Woocommerce in stock text.’ is closed to new replies.