set order_type for refunds
This commit is contained in:
parent
7d340abd6d
commit
87d8cd1c95
|
@ -448,6 +448,9 @@ function wc_create_refund( $args = array() ) {
|
||||||
if ( ! $updating ) {
|
if ( ! $updating ) {
|
||||||
update_post_meta( $refund_id, '_refund_amount', wc_format_decimal( $args['amount'] ) );
|
update_post_meta( $refund_id, '_refund_amount', wc_format_decimal( $args['amount'] ) );
|
||||||
update_post_meta( $refund_id, '_refund_tax', wc_format_decimal( $args['tax'] ) );
|
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 );
|
return new WC_Order_Refund( $refund_id );
|
||||||
|
|
Loading…
Reference in New Issue