Magento hide price in Algolia instant search page

We have installed Algolia Search on our Magento 2.3.3 store and need to hide price in Algolia instant search page for some specific products(call_for_price attribute enabled products) and display “Price on Request” instead of product price.

appreciate if anyone can help me.


Hi @marketing2

You can just edit the following template:

I hope this helps.

1 Like

hi @Youcef,

Thank you for your reply. Can you please tell me how to check if call_for__price attribute enabled or not?

{{#call_for_price = 1}}
Hide Price
{{/call_for_price}}

{{#call_for_price = 0}}
Display Price
{{/call_for_price}}

is this above if else statement correct? or how to check if call_for_price enabled pr not correctly?

Hi @marketing2,

The syntax should be this:

{{#call_for_price}}
  {{price}}
{{/call_for_price}}
{{^call_for_price}}
  Price on request.
{{/call_for_price}}

Also, you will need to set this attribute to ‘retreivable on the frontend’ and you could also access with {{{call_for_price}}}.

Hello Cindy,

I tried this. In this case Price on Request text displayed for all the items.

Is this the correct way to check call_for_price value 1 or 0?

Hi @marketing2,

Yes, I confirm this is the correct syntax to check wether call_for_price has a value of 1 or 0, you can verify that here: https://codepen.io/Algolia/pen/mdJdMOB. If you change the value of ‘boolean’ to 0, it will show Price on request, if you set it back to 1, it shows Price .

Can you check if the value you get for call_for_price is a numeric value indeed, and not a string?