How to make a link to a collection redirect to a page rather than the collection itself?!

Highlighted
New Member
4 0 0

Hi!

I have a product page that features many different collections. I want it so that if you click on a particular collection it redirects to a page instead of the collection itself. I tried URL redirects, but apparently, that only works if you have a 404 on the initial page.. Is there anyway I can do this?

Any help would be appreciated!

Kieth

0 Likes
Highlighted
Shopify Staff
Shopify Staff
548 28 81

Hey, Keith!

My name is Ava, I’m one of Shopify’s Gurus and I’m here to help :)

In order to do this, you would need to add some coding to the bottom of your collections.liquid template.

If you go to Online Store > Theme > Actions > Edit Code, you can access your themes HTML/CSS file. If you scroll to the collection.liquid template, you can try adding this piece of code to the bottom of the template - 

{% if collection.handle == 'someCollectionHandle' %}
    <script type="text/javascript">
        window.location = "https://Link-To-Page";
    </script>
{% endif %}

Then save your changes! 

This code would be similar to the one mentioned here.

This should work for most cases, but I wouldn't be able to guarantee this will work for you for sure. It would really be best to speak to a Shopify Expert about making these changes, they can tailor it to your store specifically! 
Changes like this would be unsupported by our team here, so they would not be able to assist further.

Let me know how you get on!

Ava

Social Care Guru | support@shopify.com

Ava | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
New Member
1 0 0

I also want to redirect an active collection to a page. I tried your code and it does not work for me ... 

0 Likes