We need to support shipping fees too, as already annotated by a todo comment in code. I'll provide a patch.
Please note, that currently shipping adjustments cannot be taxed, therefore many people are using patches from this issue: #2874158: Support taxing the shipping cost
imho it's too unclear now, how the final implementation will look like. By now it seems to be a not as easy to identifiable order wide tax. We'd have to fiddle that into the shipping order item.
Let's keep this clean until there's an official solution to taxing shipping fees in Commerce. I've added a @todo comment for that. I'll rather go and fix the shipping taxing issue in a custom module in the meantime
A related question is, if we also have to deal with order-wide taxes and promotions... It seems not because I've tried a coupon, which is a fixed amount off the order subtotal condition, and it still seems to be spread across the order items. So as it seems, there's no real order-level tax and discount adjustment!?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3013427-3.patch | 2.17 KB | agoradesign |
Comments
Comment #2
agoradesign commentedComment #3
agoradesign commentedComment #4
agoradesign commentednew patch, forgot to set the order item type before
Comment #5
agoradesign commentedComment #6
tuutti commentedI'm kinda hesitant to commit this because of the issue you mentioned, which is also why I originally chose not to include this feature.
Comment #7
tuutti commented... but on the other hand, not adding this now might cause some problems in the future (like double shipping fees). Assuming that shops have made their own implementations for this and then we suddenly commit this.
Comment #8
agoradesign commentedI'm voting for including it. It reflects the the current state of commerce and commerce_shipping. Currently there are shipping adjustments, which we will map to shipping_fee order items, but officially there's no way to put a tax on it. As soon there is one, we have to react on this. What we have here, is the base we'll need anyway
So either way, if you need taxing on shipping adjustments, you have to find a custom workaround or rely on a patch, in both cases the devs must be aware that there might be related problems on other places. So they need to have a sharp eye on payment gateways like this one, where so much information is collected.
Suddenly committing this on a later point and causing double fee problems could of course be another argument for committing this asap, but especially as this module does not have a tagged release, I wouldn't care too much about these things, but of course it's great to consider such facts already in an early stage.
If you'd ask me, I'd do two things: committing this and opening a separate issue about collecting VAT on shipping items and postpone that on the referenced commerce_shipping issue. And if someone gets really motivated, he/she can provide a patch there based on an assumed feature provided by a specific patch in commerce/commerce_shipping
Comment #10
tuutti commentedI agree. Thanks again!
Comment #11
agoradesign commentedYou're welcome :)
PS: I like that new getOrderItemsOfType() -> will refactor my custom code that adds the VAT on the shipping item to use this :)