Thanks for sending me the php code for out of stock to sold out text change.
/**
* Change In Stock / Out of Stock Text
*/
add_filter( ‘woocommerce_get_availability’, ‘wcs_custom_get_availability’, 1, 2);
function wcs_custom_get_availability( $availability, $_product ) {
// Change In Stock Text
if ( $_product->is_in_stock() ) {
$availability[‘availability’] = __(‘Available!’, ‘woocommerce’);
}
// Change Out of Stock Text
if ( ! $_product->is_in_stock() ) {
$availability[‘availability’] = __(‘Sold Out’, ‘woocommerce’);
}
return $availability;
It says “simply add the following code to the ‘custom functions’ area of your functions.php file” which I did not see in my functions.php so I added it to the end of the file and passed an error several times – wrapping it in <?php ?> didn’t work either. It would be really helpful if you could tell me which line to add it to in the functions.php file.
Cheers!
Isaac