search

Home  >  Q&A  >  body text

Modify the "backordered" text on the WooCommerce order receiving page.

<p>I'm trying to modify the word "reservado" or "backordered" in the order details page. </p><p>I used the following code but unfortunately did not achieve the expected result. The text of "backordered" has not changed, any suggestions? </p><p><br /></p> <pre class="brush:php;toolbar:false;">function custom_backorder_message( $text, $product ){ if ($product->is_on_backorder( 0 ) ) { $text = __( 'This item may take 3-4 weeks to deliver' ); } return $text; } add_filter( 'woocommerce_get_availability_text', 'custom_backorder_message', 10, 2 );<span style="font-family:'sans serif, tahoma, verdana, helvetica';"><span style="white-space:nowrap ;"> </span></span></pre> <p><br /></p>
P粉594941301P粉594941301518 days ago507

reply all(1)I'll reply

  • P粉426780515

    P粉4267805152023-07-31 15:01:46

    Translation: If you want to modify it through code, you can use the woocommerce_backordered_item_meta_name filter hook.

    So you get:


    function filter_woocommerce_backordered_item_meta_name( $string, $item ) {  
        // Replace with new text
        $string = 'My new text';
        
        return $string;
    }
    add_filter( 'woocommerce_backordered_item_meta_name', 'filter_woocommerce_backordered_item_meta_name', 10, 2 );
    

    But you can also make changes in the language file.

    reply
    0
  • Cancelreply