Posted on

How to change “Out Of Stock” Text

If any product is out of stock and you want to display custom massage for that product, you can do that using our plugin's Filter Hook.

function codeastrology_wpto_out_of_stock_text( $add_to_cart_text_final, $settings, $column_settings, $table_ID, $product){

    $StockQ = !$product->is_in_stock();
    if( $StockQ ){
        $add_to_cart_text_final = "Out of stock Massage";
    }
    return $add_to_cart_text_final;

}
add_filter( 'wpto_add_to_cart_text', 'codeastrology_wpto_out_of_stock_text', 10, 5);

Using that filter you can easily change Out of stock massage in the table. Use those code in your theme/child theme's functions.php file to manipulate out of stock massage.

Still no luck? We can help!

Submit a Request

Contact us and we’ll get back to you as soon as possible.