First, this is brilliant, a great help, so thanks so much for sharing!
One small issue, I am using this to test some changes to emails sent out when refunds exist on an order, both the refund email itself and any subsequent like order complete, etc.
The header of the email says "Your order has been fully refunded", even if only a partial refund was applied.
I looked at the template code here: woocommerce/templates/emails/customer-refunded-order.php
It assumes a variable $partial_refund is set to indicate a partial refund. My guess is that when this is being called here, that value is just not calculated before calling the template? I'm not sure where exactly that is getting set, the template code just assumes it will be there. :)
If it helps, I found a little breakdown on how refunds are stored in the DB and how to determine if it is a partial or full refund.
First, this is brilliant, a great help, so thanks so much for sharing!
One small issue, I am using this to test some changes to emails sent out when refunds exist on an order, both the refund email itself and any subsequent like order complete, etc.
The header of the email says "Your order has been fully refunded", even if only a partial refund was applied.
I looked at the template code here: woocommerce/templates/emails/customer-refunded-order.php
It assumes a variable $partial_refund is set to indicate a partial refund. My guess is that when this is being called here, that value is just not calculated before calling the template? I'm not sure where exactly that is getting set, the template code just assumes it will be there. :)
If it helps, I found a little breakdown on how refunds are stored in the DB and how to determine if it is a partial or full refund.
https://stackoverflow.com/questions/37712789/how-are-partial-refunds-stored-in-the-woocommerce-database