I'm building a simplified interface that is only going to be used by employees preparing the orders. They are in a usergroup that has the right permissions to update orders. I'm building this because updating an 'order status' or 'line item status' from the controlpanel is too finicky to do from a smartphone or tablet.
I've found how to update an order status here and got that working nicely.
{% set order = craft.orders.id('123').one() %}
{% do order.setAttributes({'orderStatusId': 4}, false) %}
{% do craft.app.getElements().saveElement(order) %}
What I don't know how to do is how to update the lineItemStatus. I'll probably have to fetch the order first then the lineItem id and then update the lineItemStatus attribute, but I have no idea how to even start.
Any help putting me in the right direction is greatly appreciated!
*I also know this would be better to do with a module or plugin, but alas, I don't write php.