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
799 41 122

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
2 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
Highlighted
New Member
4 0 0
Hello there. I have the same problem. I used sections to create sections on a page. Then I introduced the collections. I have 301 redirects from the collections to the pages but everytime I click on a collection in my website it takes me to the collection itself instead the page that the collectiom redirects. website : horseXperiences.com
Thank you for all your help on this
0 Likes
Highlighted
Shopify Staff
Shopify Staff
799 41 122

Hey @breedyshop!

 

I'm clicking through your website now and am not seeing any errors, the pages all seem to be directing me to the correct URL. I did notice there was a section of the homepage here that is not bringing me anywhere, is this the section you mean?

13-15-wlo8i-j3vl1

 

 

Could you go to Online Store > Theme > Customize to open the Storefront Editor? Here, you should be able to make sure a collection has been added to this section of the theme! Could you make sure a collection is added? Also, is this happening anywhere else on the site? If so, can you give me examples here?

 

Speak soon!

 

Ava
Social Care | help.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
4 0 0

Hi Ava, sorry my late reply. The link didn't work because the collections were empty. They are now full. But still, in theme costumization the only option it's to redirect that to collections as it's a collections list. Didn't want to change from collections list as the design it's the one wanted. 

 

Thank you

Pedro from horseXperiences.com

0 Likes