- Issue created by @norbert-goco
- Status changed to Needs review
11 months ago 9:07am 11 January 2024 - 🇮🇱Israel jsacksick
I guess why not... Code looks a little bit less clean, but I think the changes make sense. I tend to get the storage right before needing it instead of instantiating from the constructor nowadays (so perhaps let's just add an entityTypeManager property to the OrderRefresh) and get the storage right before using it.
Why not setting the status to "needs review" so we can see if tests are passing? - last update
11 months ago Patch Failed to Apply - 🇦🇺Australia elc
I don't believe there should be bypassing of using the API - such as not using addAdjustment or removeItem. This spreads out the functionality instead of keeping it tight and controllable. Large duplication of code having to do the same thing all over the place and then remember to do recalc at the end.
Instead, should addAdjustment and removeItem be amended to use new addAdjustmentMultiple and removeItemMultiple, which are given an array of items to work with, after which it does the normal thing of
$order->recalculateTotalPrice();
. Much more in keeping with how it works now. - 🇮🇱Israel jsacksick
You're right, thought about that, the other option would be to add an extra parameter, which defaults to TRUE to not break BC,
$recalculate_order_total = TRUE
. - Status changed to Closed: won't fix
7 months ago 11:59am 23 May 2024 - 🇮🇱Israel jsacksick
I've given this a second thought, and decided not to pursue the change as it makes the code harder to grok.