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]: Max variants number will be ignored #3845

Open
gddotorg opened this issue Jan 10, 2025 · 3 comments
Open

[5.x]: Max variants number will be ignored #3845

gddotorg opened this issue Jan 10, 2025 · 3 comments

Comments

@gddotorg
Copy link

What happened?

Description

I have a product type with max variant of 1. When I add or edit a product, I can still add as much variants as I want. Doesn't matter if I change the number. It will always be ignored.

Steps to reproduce

  1. Having a product type with max. Variant value
  2. Create a product and add variants

Expected behavior

When reaching the max. variant number, users shouldn't be able to add further variants.

Craft CMS version

5.5.9

Craft Commerce version

5.2.11

PHP version

8.2

Operating system and version

Linux 6.5.0-15-generic

Database type and version

MySQL 8.0.36

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

No response

Copy link

linear bot commented Jan 10, 2025

@gddotorg
Copy link
Author

Update: It seems on save there is a validation. So that's fine. But I want to prevent users from being able to create another variant at all. For example, the button is disabled when reaching the maximum variant number.

@lukeholder lukeholder self-assigned this Jan 13, 2025
@lukeholder
Copy link
Member

lukeholder commented Jan 13, 2025

Thanks for reporting this. We have fixed it for the next release.

To get the fix early, change your craftcms/commerce requirement in composer.json to:

"require": {
  "craftcms/commerce": "5.x-dev#379c9976fe8034518854abf198742de7874a2a4f as 5.2.11",
  "...": "..."
}

Then run composer update.

We will update this ticket once the release is out.

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

No branches or pull requests

2 participants