// ---- Etichetta DISPONIBILE ed ESAURITO su prodotti
function etichette_availability( $availability, $product ){
// Change "in stock" text
$new_availability_text = 'Disponibile' . str_replace("in stock", $availability['availability']);
$availability['availability'] = $new_availability_text;
// Change "out of stock" text
if( $availability['class'] == 'out-of-stock' ){
$availability['availability'] = 'Esaurito';
}
return $availability;
}
add_filter( 'woocommerce_get_availability', 'etichette_availability', 10, 2 );