Number of pictures on product page is always 2 more

Hi,

when going into a product page, the number of pictures for this product is presented under the picture, but this number is not currect. For example, if there are 5 pictures for a certain product, it would be displayed as 1/7 (adding a picture). The total number of pictures is always bigger in 2 than the real number.

how can i correct this?

Thnks in advance!

This looks like a bug in Dawn.

There is a code which expects second slide to be to the right of the first, but for RTL it’s not so.

You need to edit your assets/global.js and modify function initPages() around

https://github.com/Shopify/dawn/blob/b10f3120e032f7f6ad8129e1c1790b513945572f/assets/global.js#L640-L642

this.slidesPerPage = Math.floor(
      (this.slider.clientWidth - this.sliderItemsToShow[0].offsetLeft) / this.sliderItemOffset
    );

and modify it like so:

this.slidesPerPage = Math.floor(
      this.slider.clientWidth / Math.abs(this.sliderItemOffset)
    );

Looks like that Dawn is not quite ready for RTL :disappointed_face:

There is a bunch of themes in Theme Store which declare RTL compatibility, but none are free…

worked! thanks a lot!