WooCommerce - excelling eCommerce
How to change the 'Out of stock' string? (4 posts)

  1. pstranney
    Posted 2 years ago #

    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.



  2. bheadrick
    Posted 2 years ago #

    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:


    function custom_outta_stock($availability){
    $new_outta_stock = "It's Gone!";
    $availability['availability']= $new_outta_stock;
    return $availability;

  3. brightestspark
    Posted 2 years ago #

    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

  4. bheadrick
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic