You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using EVENT_POPULATE_LINE_ITEM for a long time in Commerce 3 and I've recently upgraded to 4. However now EVENT_POPULATE_LINE_ITEM seems to fire at least 3 times when an item is added to the cart. Each is identical.
We have reduced the number of recalculations in recent releases of Commerce, but it's possible for the event to fire multiple times for various reasons, like if the recalculation needs to run again after a shipping method that is selected becomes disqualified due to order value etc. So the line item could be identical each time.
You need to make sure your event handler is able to handle deciding when to modify the line item again or if can skip making the modifications.
What happened?
Description
I've been using EVENT_POPULATE_LINE_ITEM for a long time in Commerce 3 and I've recently upgraded to 4. However now EVENT_POPULATE_LINE_ITEM seems to fire at least 3 times when an item is added to the cart. Each is identical.
Steps to reproduce
Expected behavior
A single log entry is created
Actual behavior
Three log entries are created
Craft CMS version
4.5.11.1
Craft Commerce version
4.3.2
Installed plugins and versions
Gift Voucher 3.0.9
The text was updated successfully, but these errors were encountered: