totalAmount
does not update after applying shipping discount
#479
justinhenricks
started this conversation in
Feedback: Discounts APIs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've noticed that after applying discounts to shipping methods, the
totalCost
does not get updated to accurately reflect the new total cost with the discounted or free shipping option that you've discounted. It still includes the original price of the shipping option. Is this expected behavior?The problem we ran into is if a merchant wants to say: "Free shipping for orders with a total cart cost over $100" and you have a cart at say $95 with a $10 shipping option, the total cost becomes $105, applying the discount even though total cart cost (with the shipping discount) now becomes $95, which should not apply the shipping discount.
The obvious thing to do here is to use subtotal instead but where this gets tricky is when you consider combining order level discounts with shipping discounts.
Given the same rule: Free Shipping on order total over $100+.
If you have an order level discount of say: $20 off the order.
With an original cart total of $115 and a $10 shipping option, the order level discount applies and now you have a
cartTotal
of $105. The shipping discount function runs and offers free shipping bringing the actual cart total down to $95.. which should no longer qualify for the free shipping. Can't use subtotal in this use-case because it does not include the order level discount.What should the expected behavior be here? Should we expect a function to run again after a discount function runs and applies in order to get updated/accurate cart totals?
Beta Was this translation helpful? Give feedback.
All reactions