1

I want to hide price from the related products and the upsell products block

enter image description here

1 Answer 1

0

I am going to assume that you are using version 2.4.0.

The file below is responsible for rendering those lists: related, upsell, cross-sell, etc.

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

The easiest way to hide the price is to overwrite it on your theme.

app/design/Mechanic/theme/Magento_Catalog/templates/list/items.phtml

You can simply copy and paste the content of the core file to the file above that you must be created and then remove line 226:

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml#L226

Your Answer

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

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