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 line fetching in order creation #1956

Open
wants to merge 4 commits into
base: 1.x
Choose a base branch
from

Conversation

maurice-ellis
Copy link
Contributor

I'm updating the line fetching in Lunar\Pipelines\Order\Creation\CreateOrderLines and Lunar\Pipelines\Order\Creation\MapDiscountBreakdown to match the one used in Lunar\Actions\Carts\GetExistingCartLine to see if the line meta matches as well.

This PR will help be able to handle products when similar products are added instead of merged and quantity updated.

Copy link

vercel bot commented Sep 17, 2024

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

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 7:41pm

@alecritson
Copy link
Collaborator

Thanks @maurice-ellis Are you able to provide a test case to show what this is fixing within it's context?

@maurice-ellis
Copy link
Contributor Author

@alecritson I added a test case. I believe I did that correctly.

The issue is when you have 2 of the same purchasables, it causes an undefined key error in generating the breakdown because the line does not exist because the $cartLinesMappedToOrderLines only had one order line. By comparing the meta as well, it generates 2 separate lines and the error is resolved.

Not sure how to exactly test for that, but did create a case.

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