Site logo

[Support request] woocommerce – change the out of stock message

Home Forums Support [Support request] woocommerce – change the out of stock message

Home Forums Support woocommerce – change the out of stock message

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #590030
    Donna

    Hi
    is there a simple way to change out of stock notice on a product to read sold out instead?

    Thank you.

    #590044
    David
    Staff
    Customer Support

    Hi Donna,

    with this code snippet:

    add_filter( 'woocommerce_get_availability', 'db_custom_get_availability', 1, 2);
    function db_custom_get_availability( $availability, $_product ) {
        
        // Change Out of Stock Text
        if ( ! $_product->is_in_stock() ) {
            $availability['availability'] = __('Sold Out', 'woocommerce');
        }
        return $availability;
    }

    https://docs.generatepress.com/article/adding-php/

    #590079
    Donna

    Thank you so much for that.
    Where do I add it?

    #590081
    David
    Staff
    Customer Support

    Hi Donna,

    this article explains the options for adding PHP, i would recommend the Code Snippets plugin that is mentioned:

    https://docs.generatepress.com/article/adding-php/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.