fix: when same 'offer product' with different 'offer price' needs to be shown, made sure the best offer among them is shown #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
when there's multiple bumps for same products with different 'offer price' and they all are eligible to be shown in the checkout page, made sure the one with be 'best offer' (cheapest price) show's for the bump.
Before this fix, in the described scenario the bump that was created last, was showing in the checkout page for that 'offer product' regardless of their 'offer price', which shouldn't be the case.
For more clarity, take 2 bumps for example, where both of the bumps is for a product
smartphone
. One of the bump is like: if you buy alaptop
you'll get30% discount
on thesmartphone
. And the other one is, if you buy amacbook
you'll get50% discount
on that samesmartphone
.Now, if a customer adds both
laptop
&macbook
to their cart which one of 'those 2 discounts for the smartphone' should be shown?should he see the '30%' or should he see the '50%' discount?
Clearly he should get the 'best' among those 2 which is '50%'.
And that's basically what was done in this commit. Before this fix it used to show the 'offer price' from the bump that was created last.
Resolves #47