-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Seemingly all promotions activate on add-to-cart #3644
Comments
Now I am wondering about what the utility / reason for checking the rules of a line_item. I think I may be a little lost perhaps, but under what conditions would a line item have applicable rules? Here are the results of
Which should get the |
ok, so after digging a little more, it looks like in 21bf387 introduced a change to zero out the adjustment, intentionally leaving it there I suppose to avoid re-processing promotions. However, it is still the case that if a line item is checked for eligibility on a promotion, the promotion will always be shown to be eligible, as the best I can determine, a line item will never have any applicable rules. In the case where the only bonuses an action grants are adjustments, everything works out. But for the case where you have a custom promotion that does not grant a simple adjustment, the promotion will never de-activate from the order. |
Fixed with #5805 |
When an item is added to cart, the
line_item
being passed toPromotion#eligible?
activates all promotions. In most cases the problem is invisible: free shipping has no shipments to discount, an order adjustment will be flagged as ineligible, thought it has been placed on the order. But this behavior makes some promotions impossible, such as "if cart value exceeds $50 grant some incentive to check out"I can say this is true of "order discount" and "free shipping". I have not had a chance to test everything.
Solidus Version:
2.10.0
To Reproduce
Current behavior
The problem stems from perhaps a couple places. But essentially, any line item sent to the promotion model will cause a promotion to be eligible.
Expected behavior
Add-to-cart should not activate every promotion.
Additional context
Possibly tangential to #3348
The issue seems to be due to the combination of this condition in
PromotionHandler::Cart#activate
:and then the related logic in Promotion:
I'm able to put a workaround in our custom promotions but basically it seems the current rule is too permissive and it does create unnecessary / invalid adjustments as it is. I would like to take the time and write all the tests / fix the root problem with a PR but today is not the day. I'm also not sure what the exact desired behavior this situation should be as I have not yet had a chance to look at how "line item" promotions are supposed to work either.
The text was updated successfully, but these errors were encountered: