I have a "classic" database schema for order and products:
Orders
------
id
etc.
Products
--------
id
name
etc.
Order Products --> Pivot table
--------------
id --> some people don't like this, nevermind.
order_id (FK)
product_id (FK)
etc.
Now I have to deal with prices inside orders. Two problems:
- There are two currencies -dollar and euros- and price are not calculated. Let's say, sometimes a product costs $79 vs 89€, some other times $89 vs 99€
- Some products can be bought in a bundle and their prices can vary. Buying only product "A" costs $4, and buying product "A" with product "B" costs $3 + $3 (product "B" costs $3 in the "A"+"B" bundle)
Is there any simple, elegant and readable way to deal with such a problem? Maybe some part of the solution could be done outside of database, not sure.