2

In magento2 - I want to remove price from category page ( product listing ) in magento enterprise version.

2 Answers 2

5

app/design/frontend/vendor/themename/Magento_Catalog/templates/product/list.phtml

<?php  //echo $block->getProductPrice($_product) ?>

comment this line...

Note : if you not find file above path than copy from

vendor/magento/module-catalog/view/frontend/templates/product/list.phtml

to

app/design/frontend/vendor/themename/Magento_Catalog/templates/product/list.phtml

3
  • thanks. it's working. but is there any way to do same from layout.xml file? Oct 10, 2019 at 7:09
  • cannot be via layout because of getProductPrice($_product) is defined via Php code
    – Amit Bera
    Oct 10, 2019 at 7:17
  • Okay. thanks @AmitBera for information. Oct 10, 2019 at 8:05
1

We use a different solution with applying a CSS-style:

div.products.wrapper.grid.products-grid div.price-box.price-final_price, /*pricing in categories*/
{
    display: none !important;
}

We use this way to avoid problems with the updated list.phtml file by further Magento updates and in our case hiding price is only a "nice to have" but not business-critical.

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.