Refund form (Returns)

You are here:
Estimated reading time: 1 min

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 Customizer > WooCommerce > Refunds and enable it and configure the other settings.

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.

Customize 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:

  1. wc-pending — Order received (unpaid)
  2. wc-processing — Payment received and stock has been reduced; the order is awaiting fulfillment
  3. wc-on-hold — Awaiting payment – stock is reduced, but you need to confirm payment
  4. wc-completed — Order fulfilled and complete – requires no further action
  5. wc-cancelled — Canceled by an admin or the customer – no further action required (canceled orders must be manually moved)
  6. wc-refunded — Refunded by an admin – no further action required
  7. wc-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.

Was this article helpful?
Dislike 3
Views: 1387

Suggest article improvements

Please use this form to suggest improvements and report missing or outdated content. Support requests will most likely not be answered and it's best to use the Support Request Form instead. Thanks!