Hide product price for specific products
-
01-03-2021 - |
Solution
I was surprised to see some extension developers charging for this. I had a couple of hours down time. I created something. Although I can't say how it will fit with your current extension but hopefully you will all find it useful.
https://github.com/DominicWatts/Magento-2-Call-For-Price/
Toggle in Store Configuration, plus add text
Configuration
Product Edit
Product List
Product Display
OTHER TIPS
Create a product attribute. Something along the lines of 'Hide Product Price'. How to create attribute
Then in your price display template file get the attribute (credit: Magento 2: How to display custom attribute in catalog?)
$_getMyAttr = $_product->getResource()->getAttribute('my_attribute');
if ($_getMyAttr){
// Get Value
$attrTestValue = $_getMyAttr->getFrontend()->getValue($_product);
}
and use it to conditionally display your price. I believe the price template is final-price.phtml
.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange