Hi there, I wish to change the 'Out of Stock' text string on the product page to read something else. How can this be achieved? Thanks in advance.
Peter
Hi there, I wish to change the 'Out of Stock' text string on the product page to read something else. How can this be achieved? Thanks in advance.
Peter
That is hard coded into the plugin, so there's no setting in the UI to change it, but you might be able to use a filter hook to change it.
From a bit of poking around, it look like you can use the woocommerce_get_availability filter hook.
something like this:
add_filter('woocommerce_get_availability','custom_outta_stock',10);
function custom_outta_stock($availability){
$new_outta_stock = "It's Gone!";
$availability['availability']= $new_outta_stock;
return $availability;
}
I used the Codestyling Localisation plugin to find and replace "Out of stock" with "SOLD" (my site is selling one-off/original artworks).
Woothemes provides a tutorial here: http://www.woothemes.com/tutorials/how-to-translate-a-theme
Oh yeah, I forgot about localization. That's a lot easier than trying to find the applicable filter to use, but the above function does work for this particular application.
You must log in to post.