I want to use an if statement to check if a collection is “Creations” and prevent it from being displayed in the Catalog/store. I want to use this collection as a set of images to display on a custom page (I’ll remove the add to cart and price in the template as well). Thank you for any help! I am using the Debut theme. I feel like I am close with if collections.title = “Creations” but I cannot get it to work.
Hi @tscanlan
Instead of this you can use
{% if collection.title conatins 'collection name ’ %}
your code here
{% endif %}
If you have again issue with this so you can contact me on skype ( skype id : cid.6072cc42f2bf365c).
Thanks.
Hi @tscanlan
Aibek is here from Speedimize.io
You write this wrong, it should be like this:
{% if collection.title == “Creations” %}
code here
{% endif %}
You specified collections in the plural. Plus, when comparing, you must specify ==
I set a product type as “nodisplay” and I used {% if product.type != ‘nodisplay’ %} to skip over displaying those products in the “Catalog.” The products labeled with “nodisplay” do not show up as expected but I am having a problem. The store displays only 7 photos (it would be 8 minus the 1 hidden product) and says “Sorry, there are no products in this collection.” (see image)
I want to remove a collection from the global object with something like: {% collection remove: ‘/collections/creations’ %} but I don’t know what that syntax would be
How can I keep this product type from showing up and also stop from breaking the store?
My pieces of code I have bolded to make them easier to find:
- {% include 'product-card-grid', max_height: max_height, product: product, show_vendor: section.settings.show_vendor %} {% else %} {% comment %} Add default products to help with onboarding for collections/all only.
- {% else %} {%- assign is_empty_collection = true -%} {% endif %} **{% endif %}** {% endfor %}
{% endif %}
{% for product in collection.products %}
{% if product.type != ‘nodisplay’ %}
The onboarding styles and products are only loaded if the
store has no products.
{% endcomment %}
{% if collection.handle == ‘all’ and collection.all_vendors.size == 0 and collection.all_types.size == 0 %}
