How can I correct the media counter issue in my product listing?

Hey everyone. Can someone help guide me in fixing an issue I’m having?

I have listed a new product on my shop with 3 size variants. With this product, I uploaded 3 pics only. When going on the site through mobile, the images have a counter under them to toggle between the pics. It is currently showing “1/4”, “2/4”, and “3/4”. There is no 4th picture. I tried adding another picture and it started showing “4/5”. I would like to fix the media counter to show “1/3”, “2/3” and “3/3”. I don’t really know how to fix this.

I suspect the issue is in the “media_count”, but I’m not sure. The pictures are attached to the main product, and the variants have no media attached at all.

Screen Shot 2022-06-08 at 18.28.49.png

Thanks for the help

Hi @tshuqs ,

Please go to global.js file, on line 549 and change code:

Code:

if (this.slider.classList.contains('product__media-list')) {
      this.totalPages = this.sliderItemsToShow.length - this.slidesPerPage;
    } else {
      this.totalPages = this.sliderItemsToShow.length - this.slidesPerPage + 1;
    }

Hope it helps!