Remove "Free" from the collection and search page

Hi,

There is a product which I don’t wanna show its price and that’s why I entered the price as 0. And in the collection page it shows the price as Free. How can I remove the Free text in the collection page and in the search result page?

url: https://kismetbymilka.com

Is there any such rule like: when you see no price product in the collection page and in the search result page hide the price of these products?

Can someone help me in regards?

Best,

Hello @eneskbm ,

The answer is simple, you need to remove the HTML text tag (opening and closing) along with its class. This duty can be done by your developer as it requires the website backend operation expertise. Remove them and you will get the solution.

Could you please send me the collection link which collection this product call because you have lots of products.

Hello @eneskbm ,

In price code use this, I hope this helps.

{% unless product.price contains 'Free' %}
<----- Price code here ------>
{% endunless %}

Thanks,

Ritu

@MilesWeb can you help me since our developer is external and not respond me quickly. if you can provide me the solution in details, i can access to the backend and resolve the issue accordingly.

@iffikhan30 sure. you can find the product at the bottom of the collection page. looking forward to your reply.

https://kismetbymilka.com/collections/customization

hi @Ritu-25

thanks for your help! where should i insert this code exactly?

We have inspected the issue carefully and found that one tag class of Free is creating the ruckus. Kindly remove that and instead of free you can use, Customization at requirement.

That’s perfect! Where can I change the code in the backend exactly, product_liquid or where? Could you please help me in regards as well?

You need to find out the code as the code structure of your website is complex. For inspecting the code Press Ctrl+U Keys.

Mark it as solution if you are satisfied with our answer.

Regards,

MilesWeb Team

Since I’m not a developer I need to find out where and which row should be changed in the backend. If you could help me in regards of course I will mark it as a solution.

Looking forward to your help :disappointed_face:

@Ritu-25 awaiting your reply :disappointed_face:

Hey @eneskbm ,

Please Find this class in your product file. “product-thumbnail__price” you will find some code like below.

{{ product.price }}

Then just replace this with below code.

{% unless product.price contains 'Free' %}
{{product.price }}
{% endunless %}

If it’s not working the please let me know which theme you are using.

Thanks,

Ritu

Hi @Ritu-25 ,

I couldn’t find “product-thumbnail__price” or something like that :disappointed_face: When I search similar this I found these in the screenshot below.

We use Flex theme 3.0.0 by Out of the Sandbox

Awaiting your help.

Hey @eneskbm ,

Is there any file like product.liquid , card-product.liquid, or main-product.liquid?

Then go to that file and then search “product-thumbnail__price”

hey @Ritu-25 ,

I think this is the one what we are looking for but I haven’t changed anything. Better if you could take a look at this and please tell me what should I change exactly?

@eneskbm ,

Before add this code: {% unless product.price contains ‘Free’ %}

and after add this code: {% endunless %}

Refer screenshot for more clerification

@Ritu-25

I got this error below :confused:

@MilesWeb awaiting your help :confused: I think it’s related to this area below.

@eneskbm ,

Span is not which is closing there. remove that {% endunless %}

Click this : when this closing “” after that put {% endunless %}