D7 - Commerce Stock - Track products in different unit (e.g. grams?) I'm using Commerce Stock to track the amount of product stock we're currently carrying. That said, Commerce Stock only seems to let me track product in increments of 1? Is it possible for me to change the unit stock is tracked in? For example, grams? E.g. If my user purchases 10 grams, it should subtract 10 from the total 100 grams in stock.
One way of achieving this is to let Commerce Stock behave in its usual way, but to override the output on user interface, which should be pretty easy using the right hook. In other words, the custom code could just multiple stock quantity by 10 and, for example, instead of 1 output 10. So total 10 items would become 100 instead, if one item purchased then it would subtract just 1 on backend to output the remaining 9, but your function would just output 90 instead.