Last active
February 23, 2022 08:50
-
-
Save mitchellkrogza/670096d1999a8887a40a8d635c45fe03 to your computer and use it in GitHub Desktop.
Woocommerce Change Backorder Message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CHANGE WOOCOMMERCE BACKORDER TEXT | |
// Here I have used a 3 line message with inline styles to change the color and add line breaks | |
// Adapt this as you see fit | |
// Use Code Snippets Plugin to add this function or add yourself to functions.php of your child theme | |
// https://wordpress.org/plugins/code-snippets/ | |
function mywoo_backorder_message( $text, $product ){ | |
if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { | |
$text = __( '<strong><p style="color:green">New Stock is on its way !!!!<br>Backorder now - first come first served<br>Please allow 1 – 3 weeks for delivery of this item</p></strong><br>', 'your-textdomain' ); | |
} | |
return $text; | |
} | |
add_filter( 'woocommerce_get_availability_text', 'mywoo_backorder_message', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment