Created
April 8, 2019 13:55
-
-
Save ibndawood/ea3f6a86e5d457bc79974788dccf08ec to your computer and use it in GitHub Desktop.
WooCommerce - Change "Out of Stock" text to "Sold Out"
This file contains hidden or 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
add_filter( 'woocommerce_get_availability_text', 'wc_change_out_of_stock_text', 10, 2 ); | |
function wc_change_out_of_stock_text( $availability, $product ) { | |
if ( ! $product->is_in_stock() ) { | |
$availability = esc_html__( 'Sold Out', 'woocommerce' ); | |
} | |
return $availability; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment