Docs Returns for WooCommerce How to change the return status instructions for customer

How to change the return status instructions for customer

Use the customer_return_status_instructions filter to customise the instructions shown to the customer at each return status stage. Add the snippet to your child theme’s functions.php file or a site-specific snippets plugin.

1. Open your theme’s functions.php file

Navigate to your child theme’s directory and locate the functions.php file. If it doesn’t exist, create one.

2. Insert the following code snippet

Copy and paste the code snippet below into your functions.php file:

/*
* Change the instruction based return status for customer
*/

add_filter( 'customer_return_status_instructions', 'change_instruction_based_return_status', 10, 2 );

function change_instruction_based_return_status( $instruction, $return_status ) {

    //for Return Requested
    if ( 'return-requested' == $return_status ) {
        $instruction = esc_html__('Please enter the instruction for the requested items.', 'zorem-returns-exchanges');
    }

    //for Return Approved
    if ( 'return-approved' == $return_status ) {
        $instruction = esc_html__('Please enter the instruction for the approved items.', 'zorem-returns-exchanges');
    }

    //for Return Rejected
    if ( 'return-rejected' == $return_status ) {
        $instruction = esc_html__('Please enter the instruction for the rejected items.', 'zorem-returns-exchanges');
    }

    return $instruction;
}
3. Save the file

Save the changes to your functions.php file. The custom instructions will appear for the corresponding return status on the customer-facing order page.

Next Steps