0

I want to hide product price from the website.

3

1 Answer 1

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 '';
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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