-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
When remove an item the shipping is not updated correctly #2540
Comments
Hi, Can you test this against the latest version, v2.1.3? That release contains this fix which may be related: |
Sure I can test but I see in the code also in the latest version that the flag to recalculate the shipping is never set to true so I don't think it resolve. The issue in my opinion is that when for example I call the removeOrderLine in my service the output of that is a order updated also for shipping if no-one line is using this shippingline. |
And this can be done, in my opinion, if in the applyPriceAdjustments there is also the update of the shipping price based on the strategy of the shippingorderlinestrategy what do you think? |
The "recalculateShipping" flag effectively defaults to "true": vendure/packages/core/src/service/helpers/order-calculator/order-calculator.ts Lines 100 to 103 in 54953c5
I'm struggling to clearly understand the reproduction. Can you provide exact steps including the exact sequence of queries & mutations required to reproduce? |
Ok, I checked deeper the problem. I was thinking that "when I add an item to the cart (calling addOrderItem for example) in the service core also the logic to associate the line to the shipping line was running" but in reality, this is done only in the setShippingMethod of orderService. In our use case when a user add an item it set also the type of shipping and we set using the customfield on order line. So I don't know if is correct what I thinking or not let me know if I was clear. |
@giosueDelgado I've made a fix for the next patch (2.1.6) that includes a fix for this. |
Describe the bug
When I use the removeItemFromOrder the shipping is not updated correctly.
The problem is that the applyPriceAdjustments inside the orderservice not take care of the configuration of "await this.orderCalculator.applyPriceAdjustments" where there is a option that ask for recalculate the shipping.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Add the option also in the services of orderservice (removeItemFromOrder, addOrderItem, ecc..) all service that inside use the applyPriceAdjustments to give the possibility to recalculate the shipping.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: