0

I want to hide product price from the website.

0

File Path: app/code/Solwin/Module1/etc/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="Solwin\Module1\Block\HidePrice" />
</config>

File Path: Solwin\Module1\Block\HidePrice.php

    <?php
namespace Solwin\Module1\Block;
class HidePrice extends \Magento\Catalog\Pricing\Render\FinalPriceBox
{
    public function wrapResult($html)
    {
          return '';
    }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.