Customer note + email on refund action. #1755.

This commit is contained in:
Mike Jolley 2012-12-12 13:57:15 +00:00
parent 0227340934
commit c273da1aff
1 changed files with 5 additions and 1 deletions

View File

@ -1082,7 +1082,7 @@ function woocommerce_ajax_refund_order_item() {
check_ajax_referer( 'order-item', 'security' );
$order_id = absint( $_POST['order_id'] );
$order = &new WC_Order( $order_id );
$order = new WC_Order( $order_id );
if ( $order ) {
global $woocommerce;
@ -1118,6 +1118,10 @@ function woocommerce_ajax_refund_order_item() {
$refund_amount = $refund_amount + $amount;
woocommerce_update_order_item_meta( $item_id, '_refunded', 1 );
// Add order note
$order->add_order_note( sprintf( __( 'Item #%d has been refunded (%s)' ), $item_id, woocommerce_price( $amount ) ), true );
do_action( 'woocommerce_refund_order_item', $item_id );
}
}