How to write special letters

I am using this code to hide spesific collection prices, but I am struggeling with the letter “ø”
I have a collection name “pipe tilbehør” which i need to paste into the “collection.handle”
Any ieas?

{% if collection.handle == “pipe-tilbehør” %}

.price { display: none !important }

{% endif %}

Hey @Arielle_5 ,

Thank you for reaching out! I understand you’re trying to hide prices for a specific collection named “pipe tilbehør”, but you’re encountering challenges with the special character “ø” in the collection handle.

To address this, it’s important to note that Shopify automatically converts collection names into “handles” by removing special characters and replacing spaces with dashes (-). For your collection “pipe tilbehør”, Shopify likely generated the handle as “pipe-tilbehor”, replacing “ø” with “o”.

Here’s how you can modify your code to ensure it works seamlessly:

{% if collection.handle == "pipe-tilbehor" %}

{% endif %}

To confirm the exact handle of your collection, you can:

  • Go to your Shopify admin.

  • Navigate to Products > Collections and click on your collection “pipe tilbehør”.

  • Look at the URL in your browser. The part after /collections/ is your collection handle (e.g., /collections/pipe-tilbehor).

Once you’ve verified the handle, the updated code will work perfectly.

If you need further assistance or have additional requirements, feel free to reach out. I’m happy to help!

If I was able to help you, please don’t forget to Like and mark it as the Solution!

Best Regard,
Rajat

1 Like

thank you!

Also any idea how I remove the prices for featured collections on a product page?

To hide prices for featured collections on a product page, you can target the specific section where the featured collections are displayed. Here’s a general approach:

Steps to Remove Prices for Featured Collections:

  1. Identify the Section/Block:
  • Go to your product page in the Shopify theme editor and find the section/block used for displaying featured collections. Note its name or class.
  1. Use Conditional Logic to Target Only the Product Page:
  • Add a Liquid condition to check if you’re on a product page, and then apply custom CSS to hide the prices
  1. Code Example:
  • Add the following code to your theme’s product.liquid, main-product.liquid, or any template/layout file associated with your product page:
{% if template.name == 'product' %}

{% endif %}
  1. Alternative Dynamic Approach (if featured collections have a specific block): If featured collections are added using a specific block or section, wrap the logic around that block’s identifier. Example:
{% if section.settings.section_id == 'featured-collections' %}

{% endif %}

If you’re unsure of the exact class or structure, please feel free to reach out thanks.

I’m wondering where I need to add it, I’m using the canyon theme and am on the main-product.liquid

I’ve just stared coding :slightly_smiling_face:

No worries, you’re doing great! Starting with coding can feel overwhelming, but you’ll get the hang of it. If you’d like, I can help implement these changes directly—feel free to share store access, and I’ll handle it for you. :blush: