On the android app I'm working on, I need to add a line item(a tax that can't be modeled with tax rate) when certain line items are added. In addition to that, I need to delete that same tax line item when the original item is deleted from the order.

For adding line items, I've been listening to the broadcast action LINEITEMADDED and that has been working fine. For deleting line items though, there doesn't seem to exist such a broadcast(it would be great if we had something like a LINEITEMDELETED), so I'm using the OrderV31Connector.OnOrderUpdateListener2 and trying to handle the line item deleted in onLineItemsDeleted().

That method gives me an order id and a list of line item ids. The problem is that I need to get the deleted LineItems/Items in order to look at some of its properties(alternate name, tags, etc) and decide what action I should take, but as the line item has just been deleted, when I do orderConnector.getOrder(orderId).getLineItems(), the line item I'm looking for isn't there anymore.

So is it possible at all and if so, how can I find a deleted LineItem(or its backing inventory Item) by a line item id?

asked 2017-05-09 09:44:50 -0500

mateus gravatar image