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

Use correct base price in PricingResponse #2080

Open
wants to merge 1 commit into
base: 0.8
Choose a base branch
from

Conversation

se09deluca
Copy link
Contributor

Base price shouldn't be customerGroup scoped, so use $basePrice where customer_group_id is false.

The basePrice is initially retrieved correctly:

$basePrice = $prices->first(fn ($price) => $price->tier == 1 && ! $price->customer_group_id);

then is not used in PricingResponse, instead is newly retrieved loosing the condition that customer_group_id must be false.

base: $prices->first(fn ($price) => $price->tier == 1),

That makes potentially get the wrong price as basePrice

Base price shouldn't be customerGroup scoped, so use $basePrice where customer_group_id is false.
Copy link

vercel bot commented Jan 23, 2025

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 Jan 23, 2025 10:10pm

@se09deluca
Copy link
Contributor Author

I think the issue is present even in the newest 1.x branch. If you'll accept this PR, i'll create a new on based on that branch.

@alecritson
Copy link
Collaborator

alecritson commented Jan 24, 2025

@se09deluca Thanks for the fix, so is this PR valid or do you need to resubmit?

@se09deluca
Copy link
Contributor Author

se09deluca commented Jan 24, 2025

@se09deluca Thanks for the fix, so is this PR valid or do you need to resubmit?

@alecritson
Yes, from my point of view this PR is valid for the 0.8x branch. I experienced a bug in an ecommerce based on that version of lunar, so this would fix it in 0.8x branch. Later, if this PR will be accepted, i will create a new similar PR for 1.x branch.

It's ok ?

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.

2 participants