Fix: Re-add date for wc_create_refund

This commit is contained in:
Beka Rice 2017-05-17 04:46:56 -04:00
parent 34a7f9b3dd
commit 8885d58799
1 changed files with 6 additions and 0 deletions

View File

@ -540,6 +540,12 @@ function wc_create_refund( $args = array() ) {
$refund->calculate_totals( false );
$refund->set_total( $args['amount'] * -1 );
// this should remain after update_taxes(), as this will save the order, and write the current date to the db
// so we must wait until the order is persisted to set the date
if ( isset( $args['date_created'] ) ) {
$refund->set_date_created( $args['date_created'] );
}
/**
* Action hook to adjust refund before save.
* @since 3.0.0