Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is taken from the Q&A on drupalcommerce.org:
http://www.drupalcommerce.org/questions/4417/hide-price-when-outofstock
"I'm only recently started using Drupal and commerce and I try to hide the price field when a product is out-of-stock. The out-of-stock button may remain so, I just want to hide the price. The price should not be disabled, only visually be hidden."
I would think you could go a little further than the initial suggestion.