Skip to content
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

[5.x]: Can't adjust order of variants when more than 50 variants #16026

Closed
WHITE-developer opened this issue Nov 5, 2024 · 6 comments
Closed
Assignees
Labels

Comments

@WHITE-developer
Copy link

What happened?

Description

We’re experiencing an issue with reordering product variants when a product has more than 50 variants.

Initially, the order can be adjusted successfully, but after the save the variant is back at the initial place.

This is before a save:
After successfully reordering once, attempting to reorder a second time fails. During the second attempt, the variant item cannot be dragged as expected; instead, only the icons are selectable, and dragging is unresponsive.
Image

Steps to Reproduce

  1. Create a product.
  2. Add more than 50 variants to the product (e.g., 55 variants).
  3. Reorder the variants.
  4. Attempt to reorder the variants a second time, without refreshing the page.
  5. Save the page

Expected Behavior

  • The variant should be at the position it’s dragged to after the save.
  • Reordering should work consistently, allowing users to adjust the order multiple times without needing to refresh the page.

Actual Behavior

  • After the save the variant reverts to its original position.
  • Subsequent reordering fails unless the page is refreshed.

Craft CMS version

5.3.4

Craft Commerce version

5.0.16.1

PHP version

8.3.8

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Copy link

linear bot commented Nov 5, 2024

@WHITE-developer
Copy link
Author

Some extra info,

The reordering feature occasionally fails for products with fewer than 50 variants.

Example:

For a product with 13 variants, when attempting to reorder, the system displays the message "New positions saved."
However, after saving, the reordered variant reverts to its original position.
For products with more than 50 variants, the "New positions saved" message does not appear at all.
Image
Image

@nfourtythree nfourtythree transferred this issue from craftcms/commerce Nov 6, 2024
@nfourtythree
Copy link
Contributor

Hi @WHITE-developer

Thank you for the feedback, I have also managed to replicate this issue with a matrix field using element index mode on an entry.

The issue has been transferred to Craft CMS repositroy for further investigation.

Thanks!

@i-just
Copy link
Contributor

i-just commented Nov 6, 2024

Hi, thanks for reporting! I raised a PR for this.

@brandonkelly
Copy link
Member

Craft 5.4.10 is out with that fix. Thanks again!

@WHITE-developer
Copy link
Author

Thanks @i-just and @brandonkelly for the quick fix, it looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants