To change the generic “out of stock” message in WooCommerce, you will need to insert the following code to your functions.php file



add_filter('woocommerce_get_availability', 'my_get_availability', 1, 2);
 
function my_get_availability($availability, $_product)
{
 $availability = '';
}

add_filter("woocommerce_variable_sale_price_html", "my_remove_prices", 10, 2);
add_filter("woocommerce_variable_price_html", "my_remove_prices", 10, 2);
add_filter("woocommerce_get_price_html", "my_remove_prices", 10, 2);
function my_remove_prices($price, $product)
{
 if (!$product->is_in_stock())
 {
 $price = "Whoops sold";
 }
 return $price;
}


 Now change the "Whoops sold" wording to whatever you want.

You could also download code snippets plugin and insert a snippet if you don’t want to dig into your functions.php file.

1 Comment

  1. Chris

    thanks 🙂

Boutique Layouts

WordPress is built around two basic concepts. Posts and Pages. Posts are typically blog entries. A series of articles, listed (usually) reverse-chronologically.

read more

WordPress Pages Versus Posts

WordPress is built around two basic concepts. Posts and Pages. Posts are typically blog entries. A series of articles, listed (usually) reverse-chronologically.

read more

Get In Touch - Call: +44 (0) 7711 085 858

telephone

CALL: 07711-085-858

QUICK QUOTE

DESIGN | MAINTAIN | SUPPORT

You have Successfully Subscribed!

Pin It on Pinterest