In magento2 - I want to remove price from category page ( product listing ) in magento enterprise version.
2 Answers
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
-
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 -
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.