Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladimirlukyanov/f8660e53368b9439b333 to your computer and use it in GitHub Desktop.
Save vladimirlukyanov/f8660e53368b9439b333 to your computer and use it in GitHub Desktop.
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