Correction to last commit to deal with tax arrays
This commit is contained in:
parent
a588442cbb
commit
ebed8dbc85
|
@ -1812,8 +1812,8 @@ class WC_AJAX {
|
|||
$refund_amount = wc_format_decimal( sanitize_text_field( $_POST['refund_amount'] ) );
|
||||
$refund_reason = sanitize_text_field( $_POST['refund_reason'] );
|
||||
$line_item_qtys = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_qtys'] ) ), true );
|
||||
$line_item_totals = array_map( 'wc_format_decimal', json_decode( sanitize_text_field( stripslashes( $_POST['line_item_totals'] ) ), true ) );
|
||||
$line_item_tax_totals = array_map( 'wc_format_decimal', json_decode( sanitize_text_field( stripslashes( $_POST['line_item_tax_totals'] ) ), true ) );
|
||||
$line_item_totals = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_totals'] ) ), true );
|
||||
$line_item_tax_totals = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_tax_totals'] ) ), true );
|
||||
$api_refund = $_POST['api_refund'] === 'true' ? true : false;
|
||||
$restock_refunded_items = $_POST['restock_refunded_items'] === 'true' ? true : false;
|
||||
|
||||
|
@ -1850,10 +1850,10 @@ class WC_AJAX {
|
|||
}
|
||||
}
|
||||
foreach ( $line_item_totals as $item_id => $total ) {
|
||||
$line_items[ $item_id ]['refund_total'] = $total;
|
||||
$line_items[ $item_id ]['refund_total'] = wc_format_decimal( $total );
|
||||
}
|
||||
foreach ( $line_item_tax_totals as $item_id => $tax_totals ) {
|
||||
$line_items[ $item_id ]['refund_tax'] = $tax_totals;
|
||||
$line_items[ $item_id ]['refund_tax'] = array_map( 'wc_format_decimal', $tax_totals );
|
||||
}
|
||||
|
||||
// Create the refund object
|
||||
|
|
Loading…
Reference in New Issue