Skip to content

Instantly share code, notes, and snippets.

@LaurenaRehbein
Created March 27, 2019 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LaurenaRehbein/8c34ed15f6f8b66814b662d3db021d45 to your computer and use it in GitHub Desktop.
Save LaurenaRehbein/8c34ed15f6f8b66814b662d3db021d45 to your computer and use it in GitHub Desktop.
Changes the text for backorder products
add_filter( 'woocommerce_get_availability_text', 'lar_custom_change_availability_text', 15, 2 );
function lar_custom_change_availability_text( $availability, $product ) {
if ( $product->backorders_require_notification() ) {
$availability = __( 'Custom text here', 'woocommerce' );
}
return $availability;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment