Josh's answer improved a bit. Thanks to Josh for the idea of ββusing attributes!
Create the attribute code 'call_4_price' for this example. As Josh suggested, make it a yes / no attribute. The default value is None. Add it to attribute sets where you will need to hide the prices.
Find all .phtml files in which "prices and add to cart" (template> catalog> product> view.phtml, price.phtml, list.phtml, etc.)
Insert this code before the price code.
<?php $attribute = $_product->getResource()->getAttribute('call_4_price'); ?> <?php $attribute_value = $attribute ->getFrontend()->getValue($_product); ?> <?php if ($attribute_value == 'Yes'): ?> //Please Call for pricing <?php else: ?>
And this is after the add to cart button.
<?php endif; ?>
source share