-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable Product Gallery Images Out of Order when More than 10 images #22249
Comments
Hi @sjb9774. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @sjb9774 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
Hi @sjb9774 thank you for you report, i'm not able to reproduce following steps you described, this issue may be related to your cache, please flush cache and try again. thank you for collaboration. |
@magento-engcom-team give me 2.3-develop instance |
Hi @sjb9774. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @sjb9774, here is your Magento instance. |
@magento-engcom-team Thanks for the GIF, I missed that the attribute your product variation is based on needs to be setup as a swatch. There are also some scenarios where the positions are 0-indexed instead of 1-indexed as I had locally so you could need to add 11 images total. I've reproduced this issue again on a 2.3-develop instance. |
I've updated the issue description to indicate the attribute needs to be setup as a swatch. |
@sjb9774 thanks now clear 👍 |
✅ Confirmed by @engcom-backlog-nazar Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Solution
This is due to the
swatch-renderer.js
file's_sortImages
method not converting the image position values to integers first, thus sorting strings. Once you have a position of 10 or greater, you get strange orders because values of"1", "2", "10"
are sorted to"1", "10", "2"
. Wrappingswatch-renderer.js
line 700 withparseInt
fixes the problem.The text was updated successfully, but these errors were encountered: