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

Fix issue when discount relation dates are null #797

Merged
merged 4 commits into from
Jan 12, 2023

Conversation

ryanmitchell
Copy link
Contributor

This PR fixes an issue when starts_at and ends_at dates are null on channelables and customer group relations to discounts, causing the discount to not be selectable.

@vercel
Copy link

vercel bot commented Jan 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lunar-docs ✅ Ready (Inspect) Visit Preview Jan 12, 2023 at 11:23AM (UTC)

@ryanmitchell
Copy link
Contributor Author

Tests are running fine for me locally, could the error be a Github issue?

@alecritson
Copy link
Collaborator

alecritson commented Jan 12, 2023

@ryanmitchell I've updated this PR from main which should hopefully have a fix for the test failing (was unrelated to this PR)

My only question from this would be, if a Discount doesn't have a start date, should it be considered as valid active? @glennjacobs

@ryanmitchell
Copy link
Contributor Author

The change doest affect discount start/end dates - its the the start/end for the groups and channels, which arent editable through the UI so therefore default to NULL.

@alecritson
Copy link
Collaborator

@ryanmitchell I might be looking in the wrong place, when editing a discount I can see this section:

image

When clicking the the link text I get the prompt to choose dates:

image

Or am I misunderstanding?

@ryanmitchell
Copy link
Contributor Author

No I missed that they were clickable to set the dates.

But if you dont set a date they still default to NULL (as I did), so either thats acceptable or the channel/group start date needs to be defaulted to the same as the discount one?

@alecritson
Copy link
Collaborator

Yeah I'm with you now, got a bit confused. This PR is correct as if you don't have a date set for channel or group it's considered always available.

@ryanmitchell
Copy link
Contributor Author

Thanks, I should have been clearer!

@alecritson alecritson merged commit d945e4b into lunarphp:main Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants