Created
April 22, 2022 08:28
-
-
Save bradleysa/4b9ac054155c1904239d9fd8e7e6e971 to your computer and use it in GitHub Desktop.
WC: Change "Out of stock" to "Sold Out" on Single Product
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
add_filter( 'woocommerce_get_availability', 'change_out_of_stock_text_woocommerce', 1, 2 ); | |
function change_out_of_stock_text_woocommerce( $availability, $product_to_check ) { | |
// Change Out of Stock Text | |
if ( ! $product_to_check->is_in_stock() ) { | |
$availability['availability'] = __('Sold Out', 'woocommerce'); | |
} | |
return $availability; | |
} | |
/** https://wpastra.com/docs/change-woocommerce-out-of-stock-text/ **/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment