WooCommerce hide refund reason from customer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Replace refund reason with generic Refund text. | |
* | |
* @param $total_rows | |
* @param $order | |
* @param $tax_display | |
* @return array | |
*/ | |
function remove_public_facing_refund_reason( $total_rows, $order, $tax_display ) { | |
foreach ( $total_rows as $id => $row ) { | |
if ( false !== stripos( $id, 'refund_' ) ) { | |
$total_rows[ $id ]['label'] = __( 'Refund' ); | |
} | |
} | |
return $total_rows; | |
} | |
add_filter( 'woocommerce_get_order_item_totals', 'remove_public_facing_refund_reason', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment