This is a basic simple contact form that shows the customer’s orders and allows selecting which products are needed to be refunded.
How to enable?
Simply access Settings › WooCommerce › Features › Order Refunds, enable it and configure the other settings ex: screenshot .
Make sure to access Settings > Permalinks and save the settings. This will flush an internal WordPress cache. If you won’t do this step, you’ll likely get a 404 error.
Modify various internal settings. Copy the code below and paste it into the child theme’s functions.php .
add_filter('reycore/woocommerce/returns', function($settings){
$settings['subject'] = esc_html__('Return request from %s', 'text-domain');
$settings['heading'] = esc_html__('Return request', 'text-domain');
$settings['email'] = 'custom_email_address@email.com';
$settings['email_requester'] = true;
$settings['order_text'] = '{{ID}} ( {{DATE}} / {{TOTAL}}{{CURRENCY}} )';
$settings['error_not_sent'] = esc_html__('Something went wrong and the request hasn\'t been sent. Please retry later!', 'text-domain');
$settings['success_msg'] = esc_html__('Return request sent successfully.', 'text-domain');
$settings['order_args'] = [
'status' => ['wc-processing', 'wc-on-hold']
];
return $settings;
}, 20);Change the email address
By default the form sends the email towards the site administrator email defined in WP > Settings .
If you want to change it, please edit the following code and add it into the child theme’s functions.php:
add_filter('reycore/woocommerce/returns', function($settings){
$settings['email'] = 'custom_email_address@email.com';
return $settings;
}, 20);Show orders by status
add_filter('reycore/woocommerce/returns', function($settings){
$settings['order_args'] = [
'status' => ['wc-processing', 'wc-on-hold']
];
return $settings;
}, 20);Here are the keys for WooCommerce’s built-in order statuses:
wc-pending— Order received (unpaid)wc-processing— Payment received and stock has been reduced; the order is awaiting fulfillmentwc-on-hold— Awaiting payment – stock is reduced, but you need to confirm paymentwc-completed— Order fulfilled and complete – requires no further actionwc-cancelled— Canceled by an admin or the customer – no further action required (canceled orders must be manually moved)wc-refunded— Refunded by an admin – no further action requiredwc-failed— Payment failed or was declined (unpaid) or requires authentication (SCA). Note that this status may not show immediately and instead show as Pending until verified (e.g., PayPal).
Please note that additional order statuses can be added via plugins or custom code, so you may have additional statuses depending on your specific setup.