In Woocommerce, on the product page, i want to customize the "Available for back order" text for specific variations (size L and XL). So when a customer selects size L or XL, the "Available for back order" text will show "Custom Made to Measure". I know how to change the text, but how do i do it only for size L and XL? Thank you!
function change_backorder_message( $text, $product ){ if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { $text = __( 'Custom Made to Measure ', 'your-textdomain' ); } return $text; } add_filter( 'woocommerce_get_availability_text', 'change_backorder_message', 10, 2 );