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

[4.x]: Coupon max uses incorrectly set to 0 instead of left blank after Commerce4 upgrade #2947

Closed
samueldraper opened this issue Aug 24, 2022 · 5 comments
Assignees
Labels
bug commerce4 Issues related to Commerce v4

Comments

@samueldraper
Copy link

What happened?

Description

It would appear that Coupon codes created in Commerce3 are being set to max uses '0' after upgrading to Commerce4.

Steps to reproduce

  1. In control panel, go to Commerce > Promotions > Discounts
  2. Choose a discount that has coupons. Select Coupons tab.

Expected behavior

Max uses should be set to blank in Craft 4 when upgrading from Craft 3

Actual behavior

Coupons appear to be set to 0, when they should be blank.
i.e. the previous setting in Commerce 3 was Set to zero for unlimited use but the new setting is Leave blank for unlimited uses

Craft CMS version

Craft 4.2.2

Craft Commerce version

Craft 4.1.0

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@samueldraper samueldraper added commerce4 Issues related to Commerce v4 bug labels Aug 24, 2022
@nfourtythree
Copy link
Contributor

Hi @samueldraper

Thank you for your message.

There was a bug in the initial migration, we have since pushed a fix for this and added a note in the changelog for those that have upgraded early.

It would be advisable to check the values in your pre-upgraded DB against the current values.

Thanks.

@bossanova808
Copy link
Contributor

I can confirm this is in fact not fixed and is still happening with a migration (C3C3 -> latest C4C4) - done just a couple of weeks ago - i.e. maxUses set to 0.

@nfourtythree
Copy link
Contributor

Hi @bossanova808

Thank you very much for bringing this to our attention.

We have pushed a fix for the migration, meaning any future 3.x to 4.x migrations will not see this issue.

This fix will be included in the next release of Commerce 4.

Thanks!

@bossanova808
Copy link
Contributor

Jut confirming in my latest test migration this now went ok - many thanks!

@nfourtythree
Copy link
Contributor

Hi @bossanova808

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4
Projects
None yet
Development

No branches or pull requests

3 participants