is_on_backorder(0))"> Modify the "backordered" text on the WooCommerce order receiving page.-PHP Chinese Network Q&A
Modify the "backordered" text on the WooCommerce order receiving page.
P粉594941301
P粉594941301 2023-07-30 17:12:12
0
1
414

I'm trying to modify the word "reservado" or "backordered" in the order details page.

I used the following code but unfortunately did not achieve the expected result. The text of "backordered" has not changed, any suggestions?


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 ); 


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
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!