Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created February 3, 2021 04:57
Embed
What would you like to do?
add_filter( 'woocommerce_email_subject_low_stock', 'wc_custom_low_stock_subject', 20, 2 );
function wc_custom_low_stock_subject( $subject, $product ) {
return str_replace( 'Product', $product->get_name(), $subject ) . sprintf( __( ' - only %d left', 'domain' ), $product->get_stock_quantity() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment