Happening now! Shopify Community AMA: Building a Marketing Budget with 2H Media | Ask your marketing budget questions now!

Problem

Problem

snjezana
Visitor
2 0 0

Hi, so my problem is that i did this code in base.css - i added it. .collection-list .collection-list__item:has(a[href="/collections/dresses"])
{display:none}
.collection-list .collection-list__item:has(a[href="/collections/jackets"])
{display:none}
.collection-list .collection-list__item:has(a[href="/collections/trousers"])
{display:none}
.collection-list .collection-list__item:has(a[href="/collections/skirts"])
{display:none}
.collection-list .collection-list__item:has(a[href="/collections/shirts"])
{display:none}
.collection-list .collection-list__item:has(a[href="/collections/shoes"])
{display:none}
.collection-list .collection-list__item:has(a[href="/collections/t-shirts"])
{display:none} - for every collection i made for my store. And it works but just for English, when the store is on Croatian its not working. I tried this: .collection-list .collection-list__item:has(a[href="/collections/hr/pages/dresses  its still not working. 

Replies 3 (3)

Huptech-Web
Shopify Partner
1158 232 263

Hi @snjezana 
Please add the store URL.
I think the issue is that the collection & page handle is also being translated to Croatian language; that's why the CSS is not working.

Try using the same CSS but with a translated handle.
Something like the example below for dresses👇

.collection-list .collection-list__item:has(a[href="/hr/collections/haljine"])
{display:none}

 

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required

mageplaza-cs
Shopify Partner
394 32 67

Hi @snjezana 

I am from Mageplaza - Shopify solution expert.

 

To fix this issue, please follow these steps:

1. Inspect the URL Structure

    - Open your Croatian store version and right-click on the collection link (e.g., "Haljine" for Dresses).
    - Click Inspect and check the href value of the <a> tag. It may not be /collections/hr/pages/dresses.
    - Copy the correct URL and update your CSS.
2. Modify Your CSS with the Correct URLs

If the URL in Croatian is different, update your CSS accordingly. It should look like:

.collection-list .collection-list__item:has(a[href="/hr/collections/haljine"]) { display: none; }
.collection-list .collection-list__item:has(a[href="/hr/collections/jakne"]) { display: none; }
.collection-list .collection-list__item:has(a[href="/hr/collections/hlace"]) { display: none; }
.collection-list .collection-list__item:has(a[href="/hr/collections/suknje"]) { display: none; }
.collection-list .collection-list__item:has(a[href="/hr/collections/košulje"]) { display: none; }
.collection-list .collection-list__item:has(a[href="/hr/collections/cipele"]) { display: none; }
.collection-list .collection-list__item:has(a[href="/hr/collections/majice"]) { display: none; }

 

3. Use a More Flexible Selector (Alternative Solution)
If your store uses multiple languages, and you want a dynamic solution, you can use the ^= attribute selector:

.collection-list .collection-list__item:has(a[href^="/collections/dresses"]),
.collection-list .collection-list__item:has(a[href^="/hr/collections/haljine"]) {
    display: none;
}

This ensures it works for both English (/collections/dresses) and Croatian (/hr/collections/haljine).

 

Please let me know if it works as expected!

Best regards

Mageplaza | Top-Rated Shopify Agency | Trusted by 230,000+ worldwide merchants


If our suggestion works for you, please give it a Like or mark it as a Solution!


Should you have any questions or concerns, feel free to contact us via consultant@mageplaza.com

Huptech-Web
Shopify Partner
1158 232 263

Hi @snjezana 
If the solution presented meets your needs and effectively addresses your query, I encourage you to accept it as the chosen answer. This will acknowledge your support and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required