Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce hide refund reason from customer
<?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
You can’t perform that action at this time.