So I am using the following code in main-product.liquid file which is not working:
{% if collection.handle == "new-collection" %}
{% endif %}
So ideally I want to display a user input field for all products in a specific collection where handle is “new-collection”
Any help would be appreciated.
Found out solution from this Thread https://community.shopify.com/c/shopify-discussions/how-to-display-a-specific-type-of-collection-on-product-page-as/m-p/1494505#M281828
Following is the code which I used to solve my problem
{% for collection in product.collections %}
{% if collection.title contains "New Collection" %}
{% endif %}
{% endfor %}