Where to find what currency was used for payment in database
-
I’m trying to find where the data is stored, in the database, for what currency was used on individual orders.
I’m writing a PHP script calculating the total amount of all sales made with a specific coupon. But since values for other currencies are stored in their respective amount, this result is not very correct or useful.
Ex. let’s say I accept SEK and EUR. The EUR value would be 5 while the SEK value is 48.89…
So when summing up all sales with the _line_total and _line_tax from the woocommerce meta values, you would end up with incorrect data. So I need to check each sale first in my query and see what currency was used. So if EUR was used, multiply by 9.77 in this case. That way I would get a more accurate, and usable result.
- The topic ‘Where to find what currency was used for payment in database’ is closed to new replies.