WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » How to change the 'Out of stock' string?

How to change the 'Out of stock' string?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to change the 'Out of stock' string?’ is closed to new replies.
Skip to toolbar