WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. pstranney
    Member
    Posted 1 year 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.

    Peter

    http://wordpress.org/extend/plugins/woocommerce/

  2. bheadrick
    Member
    Posted 1 year 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:

    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;
    }

  3. brightestspark
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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

About this Topic

Tags