Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rename availability name of WooCommerce titles
<?php
function backorder_text($available) {
foreach ($available as $key => $i) {
$available[$key] = str_replace('In stock', 'In stock and shipping!', $available[$key]);
$available[$key] = str_replace('Out of stock', 'Sold out', $available[$key]);
}
return $available;
}
add_filter('woocommerce_get_availability', 'backorder_text', 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment