Change the order to make the code work around.

The price and total property depend on quantity, so we need to move up the code.