set order_type for refunds

This commit is contained in:
claudiosmweb 2014-07-08 16:41:07 -03:00
parent 7d340abd6d
commit 87d8cd1c95
1 changed files with 3 additions and 0 deletions

View File

@ -448,6 +448,9 @@ function wc_create_refund( $args = array() ) {
if ( ! $updating ) {
update_post_meta( $refund_id, '_refund_amount', wc_format_decimal( $args['amount'] ) );
update_post_meta( $refund_id, '_refund_tax', wc_format_decimal( $args['tax'] ) );
// Set the order type.
wp_set_object_terms( $refund_id, 'refund', 'order_type' );
}
return new WC_Order_Refund( $refund_id );