digamber89 / woo-preview-emails

WooCommerce Extension that allows you to Preview E-mails in the admin area
12 stars 7 forks source link

Partial Refunds show Fully Refunded #8

Open n9yty opened 5 years ago

n9yty commented 5 years ago

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