You can have orders and invoices tables that record a uid and a link(s) to the pdf file(s) that was send to the customer. If you want to do some stats and don't manage an inventory, you have also to record in the orders tables the characteristics you want to stat (color options, ...)
How to record product orders
Hello all, I have a generalized question on an eCommerce site and the recording of orders/invoices.
So if you have a list of products on your site that has a name, price, etc. When someone purchases you would create an order. As part of that order you would list the product with the name, price etc. The issue that I am curious about is how the order/invoice is recorded. So you really cant list the name/price directly from the database. Wouldn't you have to copy this data to another table? Otherwise if you simply connect to the ID of the product from the order you will get the current price in the database. What if the name and/or price changes after the order is placed?
Do you have an orders and order_item tables that you copy to? Do you use an order table with a json field to record item names, prices etc. I am curious how you handle this issue and what you would consider best practice.
This effects a lot of my projects. I am currently working on an education site that generates certificates. The certificate has a course name/credit hours etc. The certificate should list these items from when the course was taken. You probably do not want it updated with the current name/price just in case it changes.
Any help, advice, and/ or suggestions would be very much appreciated.
Please or to participate in this conversation.