I want to completely hide the price from the store. Be it in the catalog, product, minicart or cart. I need to do this through a custom module.

Any help is appreciated. Thanks!


This is a whole story here. But this should get you going.

The block used for product rendering in product view, product listing and so on is Magento\Catalog\Pricing\Render.

One example of usage in a layout file could be something like this.

<block class="Magento\Catalog\Pricing\Render" name="product.price.final">
         <argument name="price_render" xsi:type="string">product.price.render.default</argument>
         <argument name="price_type_code" xsi:type="string">final_price</argument>
         <argument name="zone" xsi:type="string">item_view</argument>

To remove a block you need to extend the layout file in your module|theme.

After extending the layout file you can remove a block with the following instruction

<referenceBlock name="block_name" remove="true"/>

What I would start doing is

  • create a custom module
  • identify every layout file where Magento\Catalog\Pricing\Render is used.
  • Decide if I want it removed from there and remove if so.

For the checkout area is a whole other story. Checkout is rendered with ui components. And some other areas that use them. I'm not sure how you are going to go about that.

This is the recently viewed widget where price is included via ui components. link to widget

  • I need to hide price for a specific store and not all of them. If I try to use ifconfig with referenceBlock, I get an error that ifconfig is not allowed with referenceBlock. Is there a way to hide price from everywhere using php? – coderGeek Jul 4 '19 at 20:34

For hiding the price from the store you can refer below things:

1.Hide Product Price Hide Product Price is the most powerful extension to hide product price and Add to Cart button from non registered customers. In order to see the price, a customer must need to register and login to the store. For more details use https://www.solwininfotech.com/product/magento-2-extensions/hide-product-price-magento-2/

  1. Call For Price Call For Price extension removes price & add to cart button from products and replaces it with a Call for price button. It encourages customers to contact you for price. For more details use https://www.solwininfotech.com/product/magento-2-extensions/call-for-price-magento-2/

Sorry for being late, I think this is the extension you need for hiding the price from the store: https://www.mageplaza.com/magento-2-hide-price/ Thank me later ^^

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.