2 ms·
How its handled in the system I work in is that a copy the product data is made to a new object. That new object gets converted to a final invoice eventually.
by weard_beard 3y ago
How its handled in the system I work in is that a copy the product data is made to a new object. That new object gets converted to a final invoice eventually.
A product is copied to a quote (or cart) item. A cart item is copied to an order item. A receipt or invoice is generated from an order and its items. The price of products and all their attributes can be changed without the SKU or identifier changing, but the quote, order, and invoice item is an immutable artifact.
The key problem with this system is order modifications. In order to modify an order you cancel and recreate the order from scratch. We get around this usually by piping the orders to a dedicated order management system and when orders are finalized/auth'd captured/shipped there is one final order modification that comes back to the system to capture the final state and we don't update orders continuously. This way customers see their final order state, but we don't have to cancel/recreate every change to the order along the way.