Question

I am using an extension for enable "Add to Quote" option instead of "Add to Cart" for some specific products.

How can I hide price for "Add to Quote" enabled products (attribute ves_enable_quote) and display "Price on request" text?? (as per below image)

enter image description here

Was it helpful?

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

configuration

Product Edit

configuration

Product List

result

Product Display

result

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
scroll top