Using Preference:-
app/code/Vendor/Module/etc/frontend/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Pricing\Render\FinalPriceBox" type="Vendor\Module\Pricing\Render\FinalPriceBox" />
</config>
app/code/Vendor/Module/Pricing/Render/FinalPriceBox.php
<?php
namespace Vendor\Module\Pricing\Render;
use Magento\Catalog\Model\Product\Pricing\Renderer\SalableResolverInterface;
use Magento\Catalog\Pricing\Price\MinimalPriceCalculatorInterface;
use Magento\Framework\Pricing\Price\PriceInterface;
use Magento\Framework\Pricing\Render\RendererPool;
use Magento\Framework\Pricing\SaleableInterface;
use Magento\Framework\View\Element\Template\Context;
class FinalPriceBox extends \Magento\Catalog\Pricing\Render\FinalPriceBox
{
protected $registry;
protected $helperData;
public function __construct(Context $context, SaleableInterface $saleableItem, PriceInterface $price, RendererPool $rendererPool, array $data = [], SalableResolverInterface $salableResolver = null, MinimalPriceCalculatorInterface $minimalPriceCalculator = null,\Magento\Framework\Registry $registry,\Shineretrofits\CallForPrice\Helper\Data $helperData)
{
$this->registry = $registry;
$this->helperData = $helperData;
parent::__construct($context, $saleableItem, $price, $rendererPool, $data, $salableResolver, $minimalPriceCalculator);
}
protected function wrapResult($html)
{
$current_product = $this->registry->registry('current_product');
if($current_product->getTypeId() == 'simple')
{
$result = parent::wrapResult($html);
}else{
$result = '';
}
return $result;
}
}