The price of the product may change between placing an order and payment. If we do not save the price of the order when placing the order, we will calculate it again from the changed price of the product when paying. Additionally, if we display orders in some administration panel, their price will change if we recalculate them each time using the getTotal() method.
The price should always be recalculated until checkout. This tutorial is about the shopping cart and should be kept simple for learning to code with Symfony. As I wrote in the introduction, the checkout and order process are not supported.
The price of the product may change between placing an order and payment. If we do not save the price of the order when placing the order, we will calculate it again from the changed price of the product when paying. Additionally, if we display orders in some administration panel, their price will change if we recalculate them each time using the getTotal() method.
The price should always be recalculated until checkout. This tutorial is about the shopping cart and should be kept simple for learning to code with Symfony. As I wrote in the introduction, the checkout and order process are not supported.
Oh, sure. My brain seeing the Order and OrderItem entities automatically found that this is the place to hold the order price. Sorry to bother you.
Cheers :)