Hello Mahmoud,
Sorry for the long delay.
In order to track costs you have to enable the option:
– Products > General options > Add stock
This will automatically calculate new average cost of goods for the product, based on new “Stock” and “Cost” values you enter. “Stock” will be added to your inventory, and “Cost” will be used to calculate new average cost of goods for the product.
After that you’ll have a costs history available on the admin product page.
Regarding your other question, the new costs values will only be updated in old orders if you use the option “Tools & Reports > Orders Tools > Recalculate for all orders“.
We have an option that will calculate the costs only for orders with no costs. It’s located at:
– Tools & Reports > Orders Tools > Recalculate for orders with no costs
Let me know if it helps 😉