• Hi There

    I’m using woocommerce and I want to change the text on a product from ‘available to backorder’ to ‘Will ship in March’

    I used the code below to change the out of stock text but can’t seem to find the code I need to change this.

    Thanks in advance

    add_filter( 'woocommerce_get_availability', 'custom_get_availability', 1, 2);
    
    // Our hooked in function $availablity is passed via the filter!
    function custom_get_availability( $availability, $_product ) {
    if ( !$_product->is_in_stock() ) $availability['availability'] = __('Available Again Soon, Due in 14 March 2014', 'woocommerce');
    return $availability;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • This should be what you are looking for:

    function backorder_text($available) {
    
    foreach($available as $i) {
    
    $available = str_replace('Available on backorder', 'Will ship in March', $available);
    
    }
    
    return $available;
    }
    add_filter('woocommerce_get_availability', 'backorder_text');
    Thread Starter brshcollective

    (@brshcollective)

    Thanks so much @littlehouseweb, this worked perfectly!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change available to back order text’ is closed to new replies.