Featured collection slider for Dawn Theme Shopify 2.0

Featured collection slider for Dawn Theme Shopify 2.0

This might not work with the updated Dawn Theme. If you just added Dawn theme, please check this code instead here

We created a variant slider in the product page recently. See link. We can easily use the logic for the collection slider but if we notice, we rather just use the featured collection available as a section. 

In this tutorial, we will create a collection slider using the featured collection. We just have to do some customization. 


  1. Go to your Online store > Themes > Actions > Edit code
  2. Go to Section folder and create a section, we will name it "collection-slider"
  3. In the new section, paste the code below, then click SAVE

      4.  Go to Asset folder, create a new file, name it "collection-slider"

      5. Open the newly created .css folder and paste the code below, then click SAVE



   6. We need to go to the Asset folder again. Open the global.js file and find the slider-component. At the connstructor, lets add this code below



  7. At the initPages section, replace the this.totalPages with the code below


   8.  At the update() section, replace the this.currentPage with the code below



Your code at global.js should look like below

 That's it. Let me know if you have questions (",)


Updated 10/19/21: For issues with the image has a different height with the ones, I simply delete this code below. 

 .grid--peek .grid__item:first-of-type {
padding-left: 0 !important;

Updated 11/12/21: Added a product-limit range. See code in blue.

Updated 11/24/21: Added a show all button. See the section settings to click the show all button. See code in green.


Voltar para o blogue

9 comentários

I can’t copy a code. There is no button to copy. It is like picture, uncopiable


This is a really neat feature, but is there a way to activate the list counter at the bottom? The one that looks like < 1/50 >? Nothing happens when I click the < or > symbols, and there’s no way to adjust the 1/50 value. Thanks!

Erin Rado

Hi Dheeraj,

If you are using this code in particular, you shouldn’t have any problem on having multiple sliders since the code is embed to the theme.


thank you for sharing the code. Appreciate you helping us.
I too implemented this code and it will works well for one collection-slider. But i have added 2 more collection-slider on to the home page and both have one common issue. Only 2 products are showing on screen. i tried removing and adding again or changing the collection but still only 2 products are show. Could you please advise what modification is required. thank you.


The Counter below the slider starting from 4 can you do No. of slides starting from 1 instead of no. of products starting from 4.

Arun Mohan

Deixe um comentário