Modify the "backordered" text on the WooCommerce order receiving page.
P粉594941301
P粉594941301 2023-07-30 17:12:12
0
1
505
<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粉594941301
P粉594941301

reply all(1)
P粉426780515

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template