Tax XYZ (750mL) 1.86
Tax XYZ (250mL) 0.92
In other words, custom names for different line items backed by the same variable price inventory item. Is it possible? My current solution is to use binName.
Item item = mInventoryConnector.getItem("TZ8EERTEG74XR"); item.setName("Name A"); mInventoryConnector.updateItem(item); mOrderConnector.addVariablePriceLineItem(order.getId(), item.getId(), 100, null, null); item.setName("Name B"); mInventoryConnector.updateItem(item); mOrderConnector.addVariablePriceLineItem(order.getId(), item.getId(), 200, null, null); item.setName("Original Name"); mInventoryConnector.updateItem(item);The only caveat I found was that if the price was the same, the items were grouped by together. In my example above, if the second item was priced at 100, it would list two "Name A" at $1 on the order.
I'm not sure this is what you actually want to do. If two devices are both modifying the same item to apply the temporary name, results will be unpredictable. This also mutates the item twice in addition to adding the line item.
It sounds like what you are trying to do is apply a flat tax to the order for each volume of liquor sold. The closest I can think of is adding a custom item with a specific name each time a bottle is added to the order, but I don't know if that is a good idea/meets your requirements.
2 People are following this question.