Translate text for empty product

In your function ‘translate_text’ variable $product is not initialized, so the price is always empty. You need to provide the $product for use inside the function, consider the function, it should be global. Try modifying function:

function translate_text($translated) {
  global $product;

  if ($product && empty($product->price)){
    $translated = str_ireplace('Weiterlesen', 'Contact US', $translated);
  }

  return $translated;
}

If your $product is set as global, this will work, if not, you need to set it like that, or think of another way to provide this function with outside variable.

techhipbettruvabetnorabahisbahis forumuedusedusedueduseduseduedusedueduedus